diff --git a/xiringuito b/xiringuito index ff1ee81..34593be 100755 --- a/xiringuito +++ b/xiringuito @@ -37,7 +37,7 @@ fi declare -r ORIGINAL_EXEC=${0} declare -r ORIGINAL_ARGS=${@} -while getopts "RDh" o; do +while getopts "RDrh" o; do case ${o} in R) NO_RECONNECT=true @@ -45,6 +45,9 @@ while getopts "RDh" o; do D) NO_DNS=true ;; + r) + RECONNECTING=true + ;; h) print_help exit 0 @@ -133,8 +136,8 @@ fi set +e for NETWORK in ${NETWORKS}; do - echo "> ROUTE: ${NETWORK}" - ./scripts/${KERNEL}/client-route.sh ${LOCAL_TUNNEL_ID} ${NETWORK} + echo "> ROUTE: ${NETWORK}" + [[ -z "${RECONNECTING}" ]] && ./scripts/${KERNEL}/client-route.sh ${LOCAL_TUNNEL_ID} ${NETWORK} done set -e @@ -172,5 +175,5 @@ done teardown if [[ -z "${NO_RECONNECT}" ]]; then - exec ${ORIGINAL_EXEC} ${ORIGINAL_ARGS} + exec ${ORIGINAL_EXEC} -r ${ORIGINAL_ARGS} fi