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 |
4b68ec30
|
Scott Ullrich
|
echo -n "Downing interfaces: "
|
27 |
|
|
for INTERFACE in `/sbin/ifconfig -l`; do
|
28 |
|
|
echo -n $INTERFACE
|
29 |
|
|
/sbin/ifconfig $INTERFACE down
|
30 |
|
|
done
|
31 |
|
|
|
32 |
7ab8562c
|
Scott Ullrich
|
/sbin/shutdown -r now
|