Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    210
    Likes Received:
    0
    Trophy Points:
    166
    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:
    166
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice