From 6c4d69c480714a402d6c7cf0cce35abb106f6312 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 28 Aug 2016 10:53:23 +0200 Subject: misc/setup_config.sh: production values, drop backwards compat, fix conntrack that uses stderr for normal output --- misc/setup_routing.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/misc/setup_routing.sh b/misc/setup_routing.sh index 7d86541..e11d5ee 100755 --- a/misc/setup_routing.sh +++ b/misc/setup_routing.sh @@ -1,8 +1,7 @@ #!/bin/bash -CONF_FILE=/root/config_adt.sh # (.sh is backward compat) -#CONF_FILE=/root/config_svc_test.conf -export DRY=echo # Dummy mode -#export DRY=echo_log_run # Real mode +CONF_FILE=/root/config_svc.conf +#export DRY=echo # Dummy mode +export DRY=echo_log_run # Real mode # Copyright 2016 Ludovic Pouzenc # @@ -40,7 +39,6 @@ function main() { # do_conf is called for each internet access service to (un)route function do_conf() { - shift # do_conf keyword (backward compat from time we "source $CONF_FILE") svc_etat=$1 # Mandatory svc_id=$2 # Mandatory ip4_nexthop=$3 # Optionnal (if set, NAT will be used, else direct routing will be used to ip4_public) @@ -55,7 +53,7 @@ function do_conf() { shift dev=eth1 case $svc_etat in - actif|active) # actif = backward compat + active) do_conf_enable $dev "$@" ;; cancel|suspend) do_conf_disable $dev "$@" ;; @@ -179,7 +177,7 @@ function nat_cleanup() { deleted=1 fi if [ $deleted -eq 1 ] - then $DRY conntrack -D -q $ip4_public || true + then $DRY conntrack -D -q $ip4_public 2>&1 || true fi } -- cgit v1.1