Project

General

Profile

Download (639 Bytes) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2

    
3
# $Id$
4

    
5
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
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.conf_mount_rw
19
	# Save the rrd databases to the config path.
20
	cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd
21
	/etc/rc.conf_mount_ro
22
fi
23

    
24
sleep 1
25

    
26
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
/sbin/shutdown -r now
33

    
(72-72/89)