1 |
0c48d845
|
Scott Ullrich
|
#!/bin/sh
|
2 |
5b237745
|
Scott Ullrich
|
|
3 |
7201ca27
|
jim-p
|
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
4 |
|
|
echo "Cannot shutdown at this moment, a config write operation is in progress and 30 seconds have passed."
|
5 |
6995b4fc
|
Scott Ullrich
|
exit -1
|
6 |
|
|
fi
|
7 |
|
|
|
8 |
92a5e926
|
Renato Botelho
|
product=`cat /etc/inc/globals.inc | grep product_name | cut -d'"' -f4`
|
9 |
1640b429
|
Scott Ullrich
|
|
10 |
153c8601
|
Scott Ullrich
|
echo
|
11 |
f51db33f
|
Scott Ullrich
|
echo "${product} is now shutting down ..."
|
12 |
153c8601
|
Scott Ullrich
|
echo
|
13 |
|
|
|
14 |
0c48d845
|
Scott Ullrich
|
stty status '^T'
|
15 |
5b237745
|
Scott Ullrich
|
|
16 |
|
|
# Set shell to ignore SIGINT (2), but not children;
|
17 |
0c48d845
|
Scott Ullrich
|
trap : 2
|
18 |
5b237745
|
Scott Ullrich
|
|
19 |
0c48d845
|
Scott Ullrich
|
HOME=/; export HOME
|
20 |
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
21 |
|
|
export PATH
|
22 |
5b237745
|
Scott Ullrich
|
|
23 |
99dc4c77
|
Scott Ullrich
|
# If PLATFORM is pfSense then remove
|
24 |
|
|
# temporary files on shutdown from /tmp/
|
25 |
|
|
PLATFORM=`cat /etc/platform`
|
26 |
|
|
if [ "$PLATFORM" = "pfSense" ]; then
|
27 |
004cb7c5
|
Scott Ullrich
|
find -x /tmp/* -type f -exec rm -f {} \;
|
28 |
acdd8ddf
|
Scott Ullrich
|
else
|
29 |
ef68d19c
|
jim-p
|
/etc/rc.backup_rrd.sh
|
30 |
6b5a20ab
|
jim-p
|
/etc/rc.backup_dhcpleases.sh
|
31 |
99dc4c77
|
Scott Ullrich
|
fi
|