From 46e7959ffbca294ee5305d41aaec9bdd7e1e63a3 Mon Sep 17 00:00:00 2001 From: Ivan Ilves Date: Sun, 2 Apr 2017 17:56:03 +0200 Subject: [PATCH] Remove ugly "post connect" hack --- scripts/darwin/client-teardown.sh | 2 +- scripts/linux/client-teardown.sh | 2 +- xiringuito | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/darwin/client-teardown.sh b/scripts/darwin/client-teardown.sh index 1b61332..7f61e0d 100755 --- a/scripts/darwin/client-teardown.sh +++ b/scripts/darwin/client-teardown.sh @@ -23,7 +23,7 @@ if [[ -f /etc/resolv.conf.orig ]]; then fi if [[ ${SSH_PID} -ne 0 ]]; then - kill ${SSH_PID}; sleep 1 + kill ${SSH_PID} &>/dev/null; sleep 1 fi NETWORK_SERVICE="$($(dirname ${0})/get-network-service-name.sh)" diff --git a/scripts/linux/client-teardown.sh b/scripts/linux/client-teardown.sh index f921f95..129991e 100755 --- a/scripts/linux/client-teardown.sh +++ b/scripts/linux/client-teardown.sh @@ -23,7 +23,7 @@ if [[ -f /etc/resolv.conf.orig ]]; then fi if [[ ${SSH_PID} -ne 0 ]]; then - kill ${SSH_PID}; sleep 1 + kill ${SSH_PID} &>/dev/null; sleep 1 fi ip tuntap del mode tun tun${TUNNEL_ID} diff --git a/xiringuito b/xiringuito index a9fd57d..24ef27f 100755 --- a/xiringuito +++ b/xiringuito @@ -62,9 +62,7 @@ trap 'exit 130' INT trap teardown EXIT function teardown() { - if [[ ${SSH_PID} ]]; then - ssh ${SSH_OPTS} ${SSH_SERVER} pkill -f ${REMOTE_PATH}/server-execute.sh &>/dev/null & - else + if [[ ! ${SSH_PID} ]]; then sudo ./scripts/${KERNEL}/client-teardown.sh ${$} 0 ${LOCAL_TUNNEL_ID} fi }