hi all
see the following scripts i made and tell me feedback and ideas about it
hi all
see the following scripts i made and tell me feedback and ideas about it
Last edited by s_2_s; 02-10-2005 at 03:53 AM.
asking mr google about how to read lines from files i could manage to do a script to read account user names from a file then backup each one and another script to restore them
script to backup accounts from a user list in file
note that userlist.txt should look like this#!/bin/sh
# Ilmade by s_2_s CPANEL FORUMS
cat userlist.txt | \
while read line
do
echo "Found user: $line"
/scripts/pkgacct $line
done
user1
user2
user3
user4
now to restore the backups made from the above script put the tar.gz files under same dir and excute thjis shell script
#!/bin/sh
# Ilmade by s_2_s CPANEL FORUMS
cat userlist.txt | \
while read line
do
echo "Found user: $line"
echo "I'm restoring $line ... ... ..."
/scripts/restorepkg $line
done
Last edited by s_2_s; 02-10-2005 at 04:43 AM.
how to make a list of users under one reseller ?
You could use the /var/cpanel/users/* files
something like
Could be used for the user part.Code:#!/bin/sh reseller=root for user in `/bin/ls /var/cpanel/users` do if [ "`/bin/grep 'OWNER=' /var/cpanel/users/$user | cut -d= -f2`" == "$reseller" ]; then echo "$user" >> user_list fi done
Last edited by DigitalN; 02-10-2005 at 03:44 PM.
Thank you m8
i will soon make something useful and handy from that