mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
cleanup rc.reboot ( same as rc.halt)
This commit is contained in:
parent
bd114c0d88
commit
85667d1cfb
@ -1,11 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! /usr/bin/lockf -s -t 30 /tmp/config.lock /usr/bin/true; then
|
||||
echo "Cannot reboot at this moment, a config write operation is in progress, and 30 seconds have passed."
|
||||
exit 1
|
||||
fi
|
||||
# shutdown rc scripts
|
||||
/usr/local/etc/rc.opnsense stop
|
||||
|
||||
/usr/local/etc/rc.backup_rrd
|
||||
/usr/local/etc/rc.backup_dhcpleases
|
||||
|
||||
# wait for config lock to release
|
||||
php -a >/dev/null << EOF
|
||||
\$fp = fopen('/conf/config.xml', "w+");
|
||||
if (flock(\$fp, LOCK_EX)) {
|
||||
flock(\$fp, LOCK_UN);
|
||||
fclose(\$fp);
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
/sbin/shutdown -or now
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user