The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

copy custom webalizer.conf to all home directoties? need script?

Discussion in 'General Discussion' started by nat, Oct 2, 2003.

  1. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    This seems so simple, but example i found at google aint working. I just want to copy a file to all /home/* directories and then change the permssions on the file to the correct owner.

    cPanel.net Support Ticket Number:
     
  2. Jemshi

    Jemshi Well-Known Member

    Joined:
    Sep 11, 2003
    Messages:
    210
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    not sure if cpanel reads the custom webalizer conf file. Anyway, a simple script like this should copy that.

    assuming the file is /root/webalizer.conf

    #!/bin/bash

    cd /var/cpanel/users

    for i in *
    do
    home=`grep -w "^$i" /etc/passwd | awk -F: '{print $ 6}'`
    cp /root/webalizer.conf $home/tmp/webalizer
    chown $i.$i $home/tmp/webalizer/webalizer.conf
    done

    cheers :)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page