1
|
#!/bin/sh
|
2
|
|
3
|
# $Id$
|
4
|
|
5
|
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
|
fi
|
9
|
|
10
|
sleep 1
|
11
|
|
12
|
# 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
|
/etc/rc.backup_rrd.sh
|
19
|
/etc/rc.backup_dhcpleases.sh
|
20
|
fi
|
21
|
|
22
|
sleep 1
|
23
|
|
24
|
SHUTDOWN=/sbin/shutdown
|
25
|
if [ -f /sbin/shutdown.old ]; then
|
26
|
SHUTDOWN=/sbin/shutdown.old
|
27
|
fi
|
28
|
|
29
|
$SHUTDOWN -r now
|