Project

General

Profile

Download (592 Bytes) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/bin/sh
2
3 1b8df11b Bill Marquette
# $Id$
4
5 57b66617 Scott Ullrich
if [ -f /var/run/config.lock ]; then
6
	echo "Cannot reboot at this moment, a config write operation is in progress."
7
	exit -1
8
fi
9
10 5b237745 Scott Ullrich
sleep 1
11
12 f921cfbb Scott Ullrich
# If PLATFORM is pfSense then remove
13
# temporary files on shutdown from /tmp/
14
PLATFORM=`cat /etc/platform`
15
if [ "$PLATFORM" = "pfSense" ]; then
16
	rm -rf /tmp/*
17
else
18 83df670b Scott Ullrich
	/etc/rc.conf_mount_rw
19 f921cfbb Scott Ullrich
	# Save the rrd databases to the config path.
20 79e9b652 Scott Ullrich
	cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd
21 83df670b Scott Ullrich
	/etc/rc.conf_mount_ro
22 f921cfbb Scott Ullrich
fi
23
24
sleep 1
25
26 bf072179 jim-p
SHUTDOWN=/sbin/shutdown
27
if [ -f /sbin/shutdown.old ]; then
28
	SHUTDOWN=/sbin/shutdown.old
29
fi
30
31
$SHUTDOWN -r now