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.

User name and domain name

Discussion in 'General Discussion' started by useradmin, Dec 22, 2004.

  1. useradmin

    useradmin Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    INDIA
    Hello All,

    I am trying to making awstats update script mannually using shel script help.
    I have some query please guid me properly..

    awstats solution =

    1)cp /home/user/tmp/awstats/awstats.domainname.com.conf /etc/
    2)/usr/local/cpanel/base/awstats.pl -config=domainname.com -update
    3)rm -rf /etc/awstats.domainname.com.conf

    if i make shell script like as below.

    #/bin/sh


    echo Enter Domain name
    read domain
    ##(it will get domain name only but i want to use both valu domain + user)

    i have to make shell script like
    ./awupdate either domain name or username only

    Waiting for reply....





    :confused:
     
  2. useradmin

    useradmin Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    INDIA
    Shell script help

    hello

    I have done following script but i need help from you guys

    ./awup user domainname.com
    it will work fine coz
    i define $1 = user and $2 = domain name


    #/bin/sh
    cp /home/$1/tmp/awstats/awstats.$2.conf /etc/
    /usr/local/cpanel/base/awstats.pl -config=$2 -update
    rm -rf /etc/awstats.$2.conf

    I dont want everytime ppl put domain name + user name please help me how to done with only user or domain name.
    I would like to pass only one value.....
    waiting for reply..


    :confused:
     
  3. useradmin

    useradmin Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    INDIA
    shell help urgent

    Hello alll....


    #!/bin/sh
    cp /home/$1/tmp/awstats/awstats.$2.conf /etc/
    echo conf file copy successfully
    /usr/local/cpanel/base/awstats.pl -config=$2 -update
    echo awstats update done
    echo are you sure to remove /etc/awstats.$2.conf file?
    read $3
    if [ "$3" = "y" ]; then
    rm /etc/awstats.$2.conf
    else
    echo awstats.$2.conf file is not deleted
    exit 0
    fi

    but file unable to del i dont know wheather is it comparing or not?

    please reply me....



    :confused:
     
    #3 useradmin, Dec 22, 2004
    Last edited: Dec 22, 2004
  4. useradmin

    useradmin Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    INDIA
    fixed

    hello ...

    i got the solution

    thank you.... :)
     
Loading...

Share This Page