Commit 80eefebf authored by Franco Fichtner's avatar Franco Fichtner

pkg: also rc.shutdown hook, better for ACPI shutdown

parent a25633f1
......@@ -21,6 +21,16 @@ EOF
cat /etc/rc.bak >> /etc/rc
rm -f /etc/rc.bak
echo "Hooking into /etc/rc.shutdown"
cp /etc/rc.shutdown /etc/rc.shutdown.bak
cat > /etc/rc.shutdown <<EOF
#!/bin/sh
# OPNsense rc(8) hook was automatically installed:
if [ -f /usr/local/etc/rc.shutdown ]; then /usr/local/etc/rc.shutdown; exit 0; fi
EOF
cat /etc/rc.shutdown.bak >> /etc/rc.shutdown
rm -f /etc/rc.shutdown.bak
echo "Writing package metadata"
mkdir -p /usr/local/opnsense/version
if [ -f /usr/local/opnsense/version/opnsense ]; then
......
......@@ -13,3 +13,8 @@ echo "Unhooking from /etc/rc"
cp /etc/rc /etc/rc.bak
tail -n +4 /etc/rc.bak > /etc/rc
rm -f /etc/rc.bak
echo "Unhooking from /etc/rc.shutdown"
cp /etc/rc.shutdown /etc/rc.shutdown.bak
tail -n +4 /etc/rc.shutdown.bak > /etc/rc.shutdown
rm -f /etc/rc.shutdown.bak
......@@ -98,7 +98,6 @@
/usr/local/etc/rc.firmware
/usr/local/etc/rc.firmware.subr
/usr/local/etc/rc.halt
/usr/local/etc/rc.halt.subr
/usr/local/etc/rc.initial
/usr/local/etc/rc.initial.banner
/usr/local/etc/rc.initial.defaults
......@@ -137,6 +136,7 @@
/usr/local/etc/rc.reload_interfaces
/usr/local/etc/rc.resolv_conf_generate
/usr/local/etc/rc.restart_webgui
/usr/local/etc/rc.shutdown
/usr/local/etc/rc.sshd
/usr/local/etc/rc.syshook
/usr/local/etc/rc.update_alias_url_data
......
#!/bin/sh
. /usr/local/etc/rc.halt.subr
. /usr/local/etc/rc.shutdown
/sbin/shutdown -op now
#!/bin/sh
. /usr/local/etc/rc.halt.subr
. /usr/local/etc/rc.shutdown
/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