Results 1 to 5 of 5
Hello,
I'm looking to run a script at startup of a CentOS 64Bit VPS.
I have the script pretty much written just don't know how to make it run.
Any ...
- 06-05-2010 #1Just Joined!
- Join Date
- Jun 2010
- Location
- Scotland, UK.
- Posts
- 5
Run script at boot
Hello,
I'm looking to run a script at startup of a CentOS 64Bit VPS.
I have the script pretty much written just don't know how to make it run.
Any help will be appreciated!
Thanks.
- 06-05-2010 #2
In general, you can put commands/scripts in /etc/rc.local to run at startup, or in some distros it's /etc/rc.d/rc.local.
An introduction to services, runlevels, and rc.d scripts | Linux.com
- 06-05-2010 #3Just Joined!
- Join Date
- Jun 2010
- Location
- Scotland, UK.
- Posts
- 5
I went into /etc/rc.local and it seems that is the place to put it.
So say my script is fixup.sh. Would I put;
sh /etc/fixup.sh or just /etc/fixup.sh
Also, to delete it when it's finished, would I just put rm /etc/fixup.sh the line below?
Thanks.
- 06-05-2010 #4
Just /etc/fixup.sh, but your script should be flagged as executable first.
You want to delete the script afterwards? Yeah, rm /etc/fixup.sh should work.Code:chmod +x /etc/fixup.sh
By the way, odd location for the script.
- 06-05-2010 #5Just Joined!
- Join Date
- Jun 2010
- Location
- Scotland, UK.
- Posts
- 5
It's just a very basic script to make my life a bit easier for cPanel VPS servers. I've pasted the content below. Don't laugh
, it's my first script. Any help on improving it will be appreciated!
I just need that to be run at boot up and then delete itself when finished.Code:#!/bin/bash cd echo "Updating the System" yum -y update echo "Updating cPanel/WHM" /scripts/upcp echo "Installing ConfigServer Security & Firewall" rm -fv csf.tgz wget ---csf.tgz tar -xzf csf.tgz cd csf sh install.sh cd rm -fv csf.tgz echo "Installing ConfigServer ModSecurity Control" rm -fv cmc.tgz wget ---csf.tgz tar -xzf cmc.tgz cd cmc sh install.sh cd rm -fv cmc.tgz echo "Installing ConfigServer Explorer" rm -fv cse.tgz wget ---cse.tgz tar -xzf cse.tgz cd cse sh install.sh cd rm -fv cse.tgz echo "Installing ConfigServer Mail Queues" rm -fv cmq.tgz wget ---cmq.tgz tar -xzf cmq.tgz cd cmq sh install.sh cd rm -fv cmq.tgz echo "Installing ConfigServer Mail Manage" rm -fv cmq.tgz wget ---cmm.tgz tar -xzf cmm.tgz cd cmm sh install.sh cd rm -fv cmm.tgz echo "Done!"
Thanks.


Reply With Quote