From: <abe...@us...> - 2014-11-04 03:39:21
|
Revision: 6796 http://sourceforge.net/p/astlinux/code/6796 Author: abelbeck Date: 2014-11-04 03:39:14 +0000 (Tue, 04 Nov 2014) Log Message: ----------- wan-failover, add WAN_FAILOVER_ENABLE variable so the feature can be enabled/disabled without clearing WAN_FAILOVER_TARGETS Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-04 03:39:14 UTC (rev 6796) @@ -12,7 +12,7 @@ start() { - if [ -n "$WAN_FAILOVER_TARGETS" ] && [ ! -f "$WAN_LOCKFILE" ]; then + if [ "$WAN_FAILOVER_ENABLE" = "yes" ] && [ ! -f "$WAN_LOCKFILE" ]; then echo "Starting WAN Failover..." # Start the background process Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-04 03:39:14 UTC (rev 6796) @@ -159,6 +159,7 @@ ## Secondary gateway is on: EXT2IF or via WAN_FAILOVER_SECONDARY_GW ## Note: WAN_FAILOVER_TARGETS will continue to not be reachable when the primary fails and on secondary. ## +#WAN_FAILOVER_ENABLE="yes" # Enable with "yes", defaults to "no" #WAN_FAILOVER_TARGETS="8.8.4.4 4.2.2.3" # Test targets, space separated list of IPv4 addresses #WAN_FAILOVER_SECONDARY_GW="" # (optional) Only needed if the gateway is not off EXT2IF #WAN_FAILOVER_SECONDARY_GWIPV6="" # (optional) IPv6 gateway if WAN_FAILOVER_SECONDARY_GW is defined Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-04 03:39:14 UTC (rev 6796) @@ -342,6 +342,8 @@ SECONDARY_GW="$EXT2GW" elif [ -f "/tmp/udhcpc-${EXT2IF}.conf" ]; then SECONDARY_GW="$(sed -n -r -e 's/^GW=([0-9.]+).*$/\1/p' "/tmp/udhcpc-${EXT2IF}.conf" | head -n1)" +else + SECONDARY_GW="$PRIMARY_GW" fi if [ -z "$SECONDARY_GW" ]; then log_all ERROR "Secondary interface gateway not found, exiting." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |