diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index b8c1ed64f..14d8f992c 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -172,11 +172,11 @@ function do_upgrade($path, $type) { mark_subsystem_dirty('firmwarelock'); echo "\nOne moment please...\nInvoking firmware upgrade..."; if($type == "bdiff") - mwexec_bg("/etc/rc.firmware delta_update $path"); + mwexec_bg("/usr/local/etc/rc.firmware delta_update $path"); elseif($type == "nanobsd") - mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade $path"); + mwexec_bg("/usr/local/etc/rc.firmware pfSenseNanoBSDupgrade $path"); else - mwexec_bg("/etc/rc.firmware pfSenseupgrade $path"); + mwexec_bg("/usr/local/etc/rc.firmware pfSenseupgrade $path"); sleep(10); while(is_subsystem_dirty('firmwarelock')) { sleep(1); diff --git a/tmp/pre_upgrade_command b/tmp/pre_upgrade_command index d1461875a..d90061468 100644 --- a/tmp/pre_upgrade_command +++ b/tmp/pre_upgrade_command @@ -7,8 +7,8 @@ PRIOR_VERSION=`uname -r | cut -d'.' -f1` echo $PRIOR_VERSION > /tmp/pre_upgrade_version # Hack to workaround ticket #3749 -if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; then - PROC=$(ps axwww | grep '/etc/rc.firmware *pfSenseupgrade') +if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /usr/local/etc/rc.firmware; then + PROC=$(ps axwww | grep '/usr/local/etc/rc.firmware *pfSenseupgrade') PID='' IMG='' if [ -n "${PROC}" ]; then @@ -20,8 +20,8 @@ if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; cp -fp /bin/sh /tmp/sh.old kill ${PID} >/dev/null 2>&1 kill -9 ${PID} >/dev/null 2>&1 - sed -i '' -e 's,sh /,/tmp/sh.old /,' /etc/rc.firmware - /etc/rc.firmware pfSenseupgrade "${IMG}" + sed -i '' -e 's,sh /,/tmp/sh.old /,' /usr/local/etc/rc.firmware + /usr/local/etc/rc.firmware pfSenseupgrade "${IMG}" exit fi fi diff --git a/usr/local/etc/inc/system.inc b/usr/local/etc/inc/system.inc index 8bd592519..393ba5d5d 100644 --- a/usr/local/etc/inc/system.inc +++ b/usr/local/etc/inc/system.inc @@ -1673,12 +1673,11 @@ function sync_system_time() { } -function system_halt() { - global $g; - +function system_halt() +{ system_reboot_cleanup(); - mwexec("/usr/bin/nohup /etc/rc.halt > /dev/null 2>&1 &"); + mwexec("/usr/bin/nohup /usr/local/etc/rc.halt > /dev/null 2>&1 &"); } function system_reboot() { diff --git a/etc/rc.firmware b/usr/local/etc/rc.firmware similarity index 99% rename from etc/rc.firmware rename to usr/local/etc/rc.firmware index 3c1788288..3bfe97b8d 100755 --- a/etc/rc.firmware +++ b/usr/local/etc/rc.firmware @@ -1,6 +1,5 @@ #!/bin/sh -# /etc/rc.firmware # originally part of m0n0wall (http://neon1.net/m0n0wall) # Copyright (C) 2005-2009 Scott Ullrich . # Copyright (C) 2003 Manuel Kasper . @@ -130,7 +129,7 @@ auto) touch /var/run/firmwarelock.dirty backup_chflags remove_chflags - /etc/rc.firmware_auto + /usr/local/etc/rc.firmware_auto restore_chflags /etc/rc.conf_mount_ro ;; diff --git a/etc/rc.firmware_auto b/usr/local/etc/rc.firmware_auto similarity index 92% rename from etc/rc.firmware_auto rename to usr/local/etc/rc.firmware_auto index b79c690a1..324591556 100755 --- a/etc/rc.firmware_auto +++ b/usr/local/etc/rc.firmware_auto @@ -54,12 +54,12 @@ if [ "$PMD" = "$MD" ]; then /usr/local/bin/php /etc/rc.conf_mount_rw fi if [ -r "/tmp/custom.tgz" ]; then - sh /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz + sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz else if [ "$PLATFORM" = "nanobsd" ]; then - sh /etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz + sh /usr/local/etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz else - sh /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz + sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz fi fi if [ "$PLATFORM" = "wrap" ]; then diff --git a/etc/rc.halt b/usr/local/etc/rc.halt similarity index 100% rename from etc/rc.halt rename to usr/local/etc/rc.halt diff --git a/etc/rc.shutdown b/usr/local/etc/rc.shutdown similarity index 100% rename from etc/rc.shutdown rename to usr/local/etc/rc.shutdown diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index e0b6a7840..908de4413 100644 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -148,7 +148,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) { else if (!file_exists($_FILES['ulfile']['tmp_name'])) { /* probably out of memory for the MFS */ $input_errors[] = gettext("Image upload failed (out of memory?)"); - mwexec("/etc/rc.firmware disable"); + mwexec("/usr/local/etc/rc.firmware disable"); clear_subsystem_dirty('firmware'); } else { /* move the image so PHP won't delete it */ @@ -180,15 +180,15 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) { mark_subsystem_dirty('firmwarelock'); $savemsg = gettext("The firmware is now being updated. The firewall will reboot automatically."); if (stristr($_FILES['ulfile']['name'],"nanobsd") or $_POST['isnano'] == "yes") - mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz"); + mwexec_bg("/usr/local/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz"); else if(stristr($_FILES['ulfile']['name'],"bdiff")) - mwexec_bg("/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz"); + mwexec_bg("/usr/local/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz"); else { if($g['platform'] == "nanobsd") $whichone = "pfSenseNanoBSDupgrade"; else $whichone = "pfSenseupgrade"; - mwexec_bg("/etc/rc.firmware {$whichone} {$g['upload_path']}/firmware.tgz"); + mwexec_bg("/usr/local/etc/rc.firmware {$whichone} {$g['upload_path']}/firmware.tgz"); unset($whichone); } } else diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php index 6f83bc622..15cd13d00 100755 --- a/usr/local/www/system_firmware_auto.php +++ b/usr/local/www/system_firmware_auto.php @@ -186,7 +186,7 @@ if(!$latest_version) { } /* launch external upgrade helper */ -$external_upgrade_helper_text = "/etc/rc.firmware "; +$external_upgrade_helper_text = "/usr/local/etc/rc.firmware "; if($g['platform'] == "nanobsd") $external_upgrade_helper_text .= "pfSenseNanoBSDupgrade ";