From 7488a9e09f85dc9a9208da3db9c717588a43fa6e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 18 Mar 2013 10:37:09 -0300 Subject: Fix whitespace and indent --- etc/rc.newwanip | 84 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'etc/rc.newwanip') diff --git a/etc/rc.newwanip b/etc/rc.newwanip index 4d0ecf3..d678927 100755 --- a/etc/rc.newwanip +++ b/etc/rc.newwanip @@ -1,34 +1,34 @@ #!/usr/local/bin/php -f . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. + rc.newwanip + Copyright (C) 2006 Scott Ullrich (sullrich@gmail.com) + part of pfSense (http://www.pfsense.com) + + Originally part of m0n0wall (http://m0n0.ch) + Copyright (C) 2003-2005 Manuel Kasper . + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. */ /* parse the configuration and include all functions used below */ @@ -43,7 +43,7 @@ require_once("openvpn.inc"); require_once("rrd.inc"); // Do not process while booting -if($g['booting']) +if($g['booting']) exit; function restart_packages() { @@ -52,7 +52,7 @@ function restart_packages() { /* restart packages */ system_ntp_configure(false); mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", true); - log_error("{$g['product_name']} package system has detected an ip change $oldip -> $curwanip ... Restarting packages."); + log_error("{$g['product_name']} package system has detected an ip change $oldip -> $curwanip ... Restarting packages."); send_event("service reload packages"); } @@ -62,23 +62,23 @@ $argument = str_replace("\n", "", $argv[1]); log_error("rc.newwanip: Informational is starting {$argument}."); if(empty($argument)) { - $curwanip = get_interface_ip(); - $interface = "wan"; - $interface_real = get_real_interface(); + $curwanip = get_interface_ip(); + $interface = "wan"; + $interface_real = get_real_interface(); } else { - $interface = convert_real_interface_to_friendly_interface_name($argument); - $interface_real = $argument; - $curwanip = find_interface_ip($interface_real, true); - if($curwanip == "") - $curwanip = get_interface_ip($interface); + $interface = convert_real_interface_to_friendly_interface_name($argument); + $interface_real = $argument; + $curwanip = find_interface_ip($interface_real, true); + if($curwanip == "") + $curwanip = get_interface_ip($interface); } log_error("rc.newwanip: on (IP address: {$curwanip}) (interface: {$interface}) (real interface: {$interface_real})."); if($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) { - log_error("rc.newwanip: Failed to update {$interface} IP, restarting..."); + log_error("rc.newwanip: Failed to update {$interface} IP, restarting..."); send_event("interface reconfigure {$interface}"); - exit; + exit; } if (empty($interface)) { @@ -166,8 +166,8 @@ setup_gateways_monitor(); filter_configure(); if (is_ipaddr($oldip) && $curwanip == $oldip) { - /* We need to force sync VPNs on such even when the IP is the same. Even with - * the same IP the VPN software is unhappy with the IP disappearing, and we + /* We need to force sync VPNs on such even when the IP is the same. Even with + * the same IP the VPN software is unhappy with the IP disappearing, and we * could be failing back in which case we need to switch IPs back anyhow. */ /* reconfigure IPsec tunnels */ -- cgit v1.1