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 |
|
|
|
12 |
153c8601
|
Scott Ullrich
|
echo
|
13 |
|
|
echo "pfSense is now shutting down ..."
|
14 |
|
|
echo
|
15 |
|
|
|
16 |
0c48d845
|
Scott Ullrich
|
stty status '^T'
|
17 |
5b237745
|
Scott Ullrich
|
|
18 |
|
|
# Set shell to ignore SIGINT (2), but not children;
|
19 |
0c48d845
|
Scott Ullrich
|
trap : 2
|
20 |
5b237745
|
Scott Ullrich
|
|
21 |
0c48d845
|
Scott Ullrich
|
HOME=/; export HOME
|
22 |
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
23 |
|
|
export PATH
|
24 |
5b237745
|
Scott Ullrich
|
|
25 |
99dc4c77
|
Scott Ullrich
|
# If PLATFORM is pfSense then remove
|
26 |
|
|
# temporary files on shutdown from /tmp/
|
27 |
|
|
PLATFORM=`cat /etc/platform`
|
28 |
|
|
if [ "$PLATFORM" = "pfSense" ]; then
|
29 |
|
|
rm -rf /tmp/*
|
30 |
acdd8ddf
|
Scott Ullrich
|
else
|
31 |
83df670b
|
Scott Ullrich
|
/etc/rc.conf_mount_rw
|
32 |
acdd8ddf
|
Scott Ullrich
|
# Save the rrd databases to the config path.
|
33 |
1e39020c
|
Scott Ullrich
|
tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd
|
34 |
83df670b
|
Scott Ullrich
|
/etc/rc.conf_mount_ro
|
35 |
99dc4c77
|
Scott Ullrich
|
fi
|