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 }