Leeroy1978 Posted February 15, 2005 Report Share Posted February 15, 2005 Hi folks, I'm running mandrake 10.1 and I am trying to run a script when the system boots up and then another script when the system shutsdown. The scripts basically setup my wireless pci card using the acx100 drivers and I would like for my system to sort this out without me having to type './start_net' or './stop_net' all the time. Is there a simple way to do this? Sorry if this is a really dumb question. Cheers Lee [moved from Software by spinynorman - welcome aboard :)] Quote Link to comment Share on other sites More sharing options...
thinkliberty Posted February 16, 2005 Report Share Posted February 16, 2005 Use this as a template and place it in /etc/init.d Then use the services menu in the mandrake control center to run the script at runlevel 2, 3 , 4 and 5 #!/sbin/runscript # # start stop script # /etc/init.d/custom-init-script depend() { need net } checkconfigstart() { if [ ! -e "/path/to/startscript.sh" ]; then eerror "You need a script to run first" eerror "make sure that you chmod +x the .sh" return 1 fi } checkconfigstop() { if [ ! -e "/path/to/startscript.sh" ]; then eerror "You need a script to run first" eerror "make sure that you chmod +x the .sh" return 1 fi } start() { checkconfigstart || return 1 ebegin "put what your script does here IE: loading wireless card" /path/to/startscript.sh eend $? } stop() { checkconfigstop || return 1 ebegin "put what your script does here IE: stoping wireless card" /path/to/stopscript.sh eend $? } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.