Help with a small Script
Hello,
I am wondering if someone here can help me with a small script.
I need to go into each cPanel user's public_html directory, download a scrip file (or copy from the same server) and execute it. (Basically trying to patch a security vulnerability across all sites). I can do one by one but wondering if there is a better way to do it.
So it be like,
1) Get a list of all cPanel users
and Run in a loop
2) cd /home/$username/public_html
3) wget joomla.org/ptch-001.sh (or cp /root/patch-001.sh /home/$username/public_html/)
4) sh patch-001.sh
5) sleep 10
Can someone here help me with something like this or point me in a direction what would be the best way to do it?
Thanks
-
Please try following for loop command on your server to apply security patch for your all user. for username in `ls /var/cpanel/users` ;do cd /home/$username/public_html ;cp /root/patch-001.sh /home/$username/public_html/ ; sh patch-001.sh ;sleep 10;done0 -
Thanks for sharing this info here. 0 -
@Raggie A Pauly You are welcome ! Please update here if need any help related this process. 0 -
Hello, I've moved this thread to our "Workarounds and Optimization" forum. Thanks! 0
Please sign in to leave a comment.
Comments
4 comments