dacool25
March 13th, 2008, 11:21 PM
Hey there guys,
I'm trying to run a script so that I don't have to type the commands all the time. Here is a little background to what is for first though: Well I am using ISPConfig and whenever it writes any files it overdoes any changes that I do to users and permissions within its folders. So I would like to create a script that will just automate the commands that i do.
I have a few problems, one of which being that they all have to be run via sudo or su
Anyways, here is my script, can someone help me why it isn't working? Just bear in mind that i'm not very good with scripts,
Thanks
sudo -s adduser webuser webusers
sudo -s chgrp -R webusers /var/www/web1/web
sudo -s chgrp -R webusers /var/www/web2/web
sudo -s chgrp -R webusers /var/www/web3/web
sudo -s chgrp -R webusers /var/www/web4/web
sudo -s chgrp -R webusers /var/www/web5/web
sudo -s chgrp -R webusers /var/www/web6/web
sudo -s chgrp -R webusers /var/www/web7/web
sudo -s chmod -R 775 /var/www/web1/web
sudo -s chmod -R 775 /var/www/web2/web
sudo -s chmod -R 775 /var/www/web3/web
sudo -s chmod -R 775 /var/www/web4/web
sudo -s chmod -R 775 /var/www/web5/web
sudo -s chmod -R 775 /var/www/web6/web
sudo -s chmod -R 775 /var/www/web7/web
PS what should i save it as?
thanks
I'm trying to run a script so that I don't have to type the commands all the time. Here is a little background to what is for first though: Well I am using ISPConfig and whenever it writes any files it overdoes any changes that I do to users and permissions within its folders. So I would like to create a script that will just automate the commands that i do.
I have a few problems, one of which being that they all have to be run via sudo or su
Anyways, here is my script, can someone help me why it isn't working? Just bear in mind that i'm not very good with scripts,
Thanks
sudo -s adduser webuser webusers
sudo -s chgrp -R webusers /var/www/web1/web
sudo -s chgrp -R webusers /var/www/web2/web
sudo -s chgrp -R webusers /var/www/web3/web
sudo -s chgrp -R webusers /var/www/web4/web
sudo -s chgrp -R webusers /var/www/web5/web
sudo -s chgrp -R webusers /var/www/web6/web
sudo -s chgrp -R webusers /var/www/web7/web
sudo -s chmod -R 775 /var/www/web1/web
sudo -s chmod -R 775 /var/www/web2/web
sudo -s chmod -R 775 /var/www/web3/web
sudo -s chmod -R 775 /var/www/web4/web
sudo -s chmod -R 775 /var/www/web5/web
sudo -s chmod -R 775 /var/www/web6/web
sudo -s chmod -R 775 /var/www/web7/web
PS what should i save it as?
thanks