From 38496c2c256e7d6724dcf6f887cb1f5800024cbd Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 3 May 2015 15:51:09 +0200 Subject: [PATCH] adb-channel: also delete temps on SIGHUP. --- adb-channel | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adb-channel b/adb-channel index 28f0a3e..8d9a90b 100755 --- a/adb-channel +++ b/adb-channel @@ -6,7 +6,7 @@ t=`mktemp -d -t adb-channel.XXXXXX` remote=${1} activity=${2} -delat=${3} +delay=${3} atexit() { [ -z "${activity}" ] || adb shell am force-stop ${activity%%/*} @@ -14,8 +14,9 @@ atexit() { rm -rf "${t}" } trap atexit EXIT +trap 'exit 0' HUP [ -z "${activity}" ] || adb shell am start -W ${activity} [ -z "${delay}" ] || sleep "${delay}" -adb forward localfilesystem:"${t}/sock" "${1}" +adb forward localfilesystem:"${t}/sock" "${remote}" socat stdio unix:"${t}/sock"