Commit 85667d1c authored by Ad Schellevis's avatar Ad Schellevis

cleanup rc.reboot ( same as rc.halt)

parent bd114c0d
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment