summaryrefslogtreecommitdiffstats
path: root/etc/rc.shutdown
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-05-06 00:38:36 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-05-06 00:38:36 +0000
commit6ac2abcba25090cfd4b91e02408a2889a987981d (patch)
treefa3fbb8bf886f9d1fca0302657f5324905bcebf2 /etc/rc.shutdown
parent93e251a4ba67244d3629a551dea446f2e1e6fe37 (diff)
downloadpfsense-6ac2abcba25090cfd4b91e02408a2889a987981d.zip
pfsense-6ac2abcba25090cfd4b91e02408a2889a987981d.tar.gz
Convert rc.shutdown to php script, gracefully shutdown carp interfaces on shutdown
Diffstat (limited to 'etc/rc.shutdown')
-rwxr-xr-xetc/rc.shutdown22
1 files changed, 13 insertions, 9 deletions
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index 08e22ad..2f7bc60 100755
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -1,19 +1,23 @@
-#!/bin/sh
+#!/usr/local/bin/php
# $Id$
-stty status '^T'
+exec("stty status '^T'");
# Set shell to ignore SIGINT (2), but not children;
# shell catches SIGQUIT (3) and returns to single user after fsck.
-trap : 2
-trap : 3 # shouldn't be needed
+exec("trap : 2");
+exec("trap : 3");
-HOME=/
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
-export HOME PATH
+require("guiconfig.inc");
-# Insert other shutdown procedures here
+/* bring down carp gracefully */
+$carp_counter=find_number_of_created_carp_interfaces();
+mwexec("/sbin/sysctl net.inet.carp.allow=0");
+for($x=0; $x<$carp_counter; $x++) {
+ mwexec("/sbin/ifconfig carp{$x} down");
+ mwexec("/sbin/ifconfig carp{$x} destroy");
+}
-exit 0
+exit 0;
OpenPOWER on IntegriCloud