diff --git a/+POST_INSTALL b/+POST_INSTALL index 91922c95c..231721e25 100644 --- a/+POST_INSTALL +++ b/+POST_INSTALL @@ -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 <> /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 diff --git a/+PRE_DEINSTALL b/+PRE_DEINSTALL index 43e013faf..eeda8aa12 100644 --- a/+PRE_DEINSTALL +++ b/+PRE_DEINSTALL @@ -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 diff --git a/plist b/plist index 0183bb9c8..d00cf6f87 100644 --- a/plist +++ b/plist @@ -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 diff --git a/src/etc/rc.halt b/src/etc/rc.halt index ff8fef693..36d940bf5 100755 --- a/src/etc/rc.halt +++ b/src/etc/rc.halt @@ -1,5 +1,5 @@ #!/bin/sh -. /usr/local/etc/rc.halt.subr +. /usr/local/etc/rc.shutdown /sbin/shutdown -op now diff --git a/src/etc/rc.reboot b/src/etc/rc.reboot index 1e42efcc1..821ff1538 100755 --- a/src/etc/rc.reboot +++ b/src/etc/rc.reboot @@ -1,5 +1,5 @@ #!/bin/sh -. /usr/local/etc/rc.halt.subr +. /usr/local/etc/rc.shutdown /sbin/shutdown -or now diff --git a/src/etc/rc.halt.subr b/src/etc/rc.shutdown similarity index 100% rename from src/etc/rc.halt.subr rename to src/etc/rc.shutdown