[SunHELP] Problem starting application automatically during boot-up.

Mr Rene Occelli rene at polytech.univ-mrs.fr
Mon Jun 6 08:47:20 CDT 2005


Hi,
Below a simple script I put in rc2.d to alert me when a machine reboots
Name is S99reboot
------------------------
#!/bin/sh
#  just a mail  when reboot occurs 
mode=$1

if [ ! -d /usr/bin ]
then			# /usr not mounted
	exit 1
fi

set `/usr/bin/id`
if [ $1 != "uid=0(root)" ]; then
        echo "$0: must be run as root"
        exit 1
fi
host="`uname -n`"
moi="may mail adress"


case "$mode" in

'start')  
        echo "Reboot of $host : " `date` | mailx -s $host $moi
        ;;

'stop') 	
        echo "Stop of $host : " `date` | mailx -s $host  $moi
	;;


*)
	echo " Option unknown"
	exit 1
	;;
esac

exit 0


---------------
By
Rene



More information about the SunHELP mailing list