Project

General

Profile

Download (803 Bytes) Statistics
| Branch: | Tag: | Revision:
1 0c48d845 Scott Ullrich
#!/bin/sh
2 5b237745 Scott Ullrich
3 6995b4fc Scott Ullrich
if [ -f /var/run/config.lock ]; then
4
	echo "Cannot reboot at this moment, a config write operation is in progress."
5
	exit -1
6
fi
7
8 1640b429 Scott Ullrich
if [ -e /dev/ukbd0 ]; then
9
        /usr/sbin/vidcontrol -s 2
10
fi
11 f51db33f Scott Ullrich
12
product=`cat /etc/inc/globals.inc | grep product_name | cut -d'"' -f4`
13 1640b429 Scott Ullrich
        
14 153c8601 Scott Ullrich
echo
15 f51db33f Scott Ullrich
echo "${product} is now shutting down ..."
16 153c8601 Scott Ullrich
echo
17
18 0c48d845 Scott Ullrich
stty status '^T'
19 5b237745 Scott Ullrich
20
# Set shell to ignore SIGINT (2), but not children;
21 0c48d845 Scott Ullrich
trap : 2
22 5b237745 Scott Ullrich
23 0c48d845 Scott Ullrich
HOME=/; export HOME
24
PATH=/sbin:/bin:/usr/sbin:/usr/bin
25
export PATH
26 5b237745 Scott Ullrich
27 99dc4c77 Scott Ullrich
# If PLATFORM is pfSense then remove
28
# temporary files on shutdown from /tmp/
29
PLATFORM=`cat /etc/platform`
30
if [ "$PLATFORM" = "pfSense" ]; then
31
	rm -rf /tmp/*
32 acdd8ddf Scott Ullrich
else
33 83df670b Scott Ullrich
	/etc/rc.conf_mount_rw
34 acdd8ddf Scott Ullrich
	# Save the rrd databases to the config path.
35 79e9b652 Scott Ullrich
	cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd
36 83df670b Scott Ullrich
	/etc/rc.conf_mount_ro
37 99dc4c77 Scott Ullrich
fi