summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2016-08-28 10:53:23 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2016-08-28 10:53:23 +0200
commit6c4d69c480714a402d6c7cf0cce35abb106f6312 (patch)
tree14b956bebd465bbd5bf37f4368a129bf02fd9e6b
parent1bb5446d00b5a8b106470eb54f828ec64503f879 (diff)
downloadchd_gestion-6c4d69c480714a402d6c7cf0cce35abb106f6312.zip
chd_gestion-6c4d69c480714a402d6c7cf0cce35abb106f6312.tar.gz
chd_gestion-6c4d69c480714a402d6c7cf0cce35abb106f6312.tar.bz2
misc/setup_config.sh: production values, drop backwards compat, fix conntrack that uses stderr for normal output
-rwxr-xr-xmisc/setup_routing.sh12
1 files 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 <ludovic@pouzenc.fr>
#
@@ -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
}