PDA

View Full Version : How to run a script at startup?



eSology
02-11-2006, 05:37 AM
I can't remember how I did this before. Just installed FreeBSD 5.4 and DirectAdmin -- need to have RealChat strated at boot up. Here is the Linux "how to":

cp ./realchat /etc/init.d/
update-rc.d realchat defaults

eSology
02-12-2006, 01:10 PM
Which of these would be better to use?

---------------------------------------------------------
#!/bin/sh

case "$1" in
start)
/usr/local/server/realchat
;;
stop)
killall realchat
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac

exit 0


---------------------------------------------------------

#!/bin/sh


case "$1" in

start)
/usr/local/server/realchat
;;

stop)
killall realchat
;;

*)
echo "Usage: $(basename $0) (start|stop)" >&2
;;

esac

jmstacey
02-12-2006, 02:21 PM
It shouldn't matter. They're nearly identical except for the exits and how basename is retrieved.

Best call, whichever one works properly :p ;)