1 |
5b237745
|
Scott Ullrich
|
#!/bin/sh
|
2 |
ac24dc24
|
Renato Botelho
|
#
|
3 |
|
|
# rc.reboot
|
4 |
|
|
#
|
5 |
|
|
# part of pfSense (https://www.pfsense.org)
|
6 |
38809d47
|
Renato Botelho do Couto
|
# Copyright (c) 2004-2013 BSD Perimeter
|
7 |
|
|
# Copyright (c) 2013-2016 Electric Sheep Fencing
|
8 |
8f585441
|
Luiz Souza
|
# Copyright (c) 2014-2021 Rubicon Communications, LLC (Netgate)
|
9 |
ac24dc24
|
Renato Botelho
|
# All rights reserved.
|
10 |
|
|
#
|
11 |
b12ea3fb
|
Renato Botelho
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
12 |
|
|
# you may not use this file except in compliance with the License.
|
13 |
|
|
# You may obtain a copy of the License at
|
14 |
ac24dc24
|
Renato Botelho
|
#
|
15 |
b12ea3fb
|
Renato Botelho
|
# http://www.apache.org/licenses/LICENSE-2.0
|
16 |
ac24dc24
|
Renato Botelho
|
#
|
17 |
b12ea3fb
|
Renato Botelho
|
# Unless required by applicable law or agreed to in writing, software
|
18 |
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
19 |
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20 |
|
|
# See the License for the specific language governing permissions and
|
21 |
|
|
# limitations under the License.
|
22 |
1b8df11b
|
Bill Marquette
|
|
23 |
7201ca27
|
jim-p
|
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
24 |
|
|
echo "Cannot reboot at this moment, a config write operation is in progress, and 30 seconds have passed."
|
25 |
|
|
exit 1
|
26 |
57b66617
|
Scott Ullrich
|
fi
|
27 |
|
|
|
28 |
b34c29cb
|
Renato Botelho
|
unset REROOT
|
29 |
|
|
if [ "${1}" = "-r" ]; then
|
30 |
|
|
REROOT=${1}
|
31 |
|
|
fi
|
32 |
|
|
|
33 |
5b237745
|
Scott Ullrich
|
sleep 1
|
34 |
|
|
|
35 |
dc61252a
|
Renato Botelho
|
# Remove temporary files on shutdown from /tmp/
|
36 |
|
|
rm -rf /tmp/*
|
37 |
e92e83d4
|
jim-p
|
|
38 |
82bf21fc
|
jim-p
|
. /etc/rc.ramdisk_functions.sh
|
39 |
|
|
ramdisk_make_backup
|
40 |
f921cfbb
|
Scott Ullrich
|
|
41 |
|
|
sleep 1
|
42 |
|
|
|
43 |
22b43392
|
jim-p
|
/sbin/reboot ${REROOT}
|