rc.halt 387 Bytes
Newer Older
Ad Schellevis's avatar
Ad Schellevis committed
1 2 3 4 5 6 7 8 9
#!/bin/sh

if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
	echo "Cannot halt at this moment, a config write operation is in progress and 30 seconds have passed."
	exit -1
fi

sleep 1

10 11 12 13 14 15 16 17 18 19 20
/usr/local/etc/rc.backup_rrd
/usr/local/etc/rc.backup_dhcpleases

sleep 1

SHUTDOWN=/sbin/shutdown
if [ -f /sbin/shutdown.old ]; then
	SHUTDOWN=/sbin/shutdown.old
fi

$SHUTDOWN -p now