useradmin

Well-Known Member
Oct 8, 2004
107
0
166
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:
 

useradmin

Well-Known Member
Oct 8, 2004
107
0
166
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:
 

useradmin

Well-Known Member
Oct 8, 2004
107
0
166
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:
 
Last edited:

useradmin

Well-Known Member
Oct 8, 2004
107
0
166
INDIA
fixed

hello ...

i got the solution

thank you.... :)