diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-05-06 00:38:36 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-05-06 00:38:36 +0000 |
commit | 6ac2abcba25090cfd4b91e02408a2889a987981d (patch) | |
tree | fa3fbb8bf886f9d1fca0302657f5324905bcebf2 /etc/rc.shutdown | |
parent | 93e251a4ba67244d3629a551dea446f2e1e6fe37 (diff) | |
download | pfsense-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-x | etc/rc.shutdown | 22 |
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; |