1 |
5b237745
|
Scott Ullrich
|
#!/bin/sh
|
2 |
|
|
|
3 |
1b8df11b
|
Bill Marquette
|
# $Id$
|
4 |
|
|
|
5 |
7201ca27
|
jim-p
|
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
6 |
|
|
echo "Cannot reboot at this moment, a config write operation is in progress, and 30 seconds have passed."
|
7 |
|
|
exit 1
|
8 |
57b66617
|
Scott Ullrich
|
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 |
e92e83d4
|
jim-p
|
fi
|
18 |
|
|
|
19 |
|
|
USE_MFS_TMPVAR=`/usr/bin/grep -c use_mfs_tmpvar /cf/conf/config.xml`
|
20 |
|
|
DISK_NAME=`/bin/df /var/db/rrd | /usr/bin/tail -1 | /usr/bin/awk '{print $1;}'`
|
21 |
|
|
DISK_TYPE=`/usr/bin/basename ${DISK_NAME} | /usr/bin/cut -c1-2`
|
22 |
|
|
# If we are not on a full install, or if the full install wants RAM disks, or if the full install _was_ using RAM disks, but isn't for the next boot...
|
23 |
|
|
if [ "${PLATFORM}" != "pfSense" ] || [ ${USE_MFS_TMPVAR} -gt 0 ] || [ "${DISK_TYPE}" = "md" ]; then
|
24 |
ef68d19c
|
jim-p
|
/etc/rc.backup_rrd.sh
|
25 |
6b5a20ab
|
jim-p
|
/etc/rc.backup_dhcpleases.sh
|
26 |
f921cfbb
|
Scott Ullrich
|
fi
|
27 |
|
|
|
28 |
|
|
sleep 1
|
29 |
|
|
|
30 |
bf072179
|
jim-p
|
SHUTDOWN=/sbin/shutdown
|
31 |
|
|
if [ -f /sbin/shutdown.old ]; then
|
32 |
|
|
SHUTDOWN=/sbin/shutdown.old
|
33 |
|
|
fi
|
34 |
|
|
|
35 |
|
|
$SHUTDOWN -r now
|