We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf309f9 commit 8f36071Copy full SHA for 8f36071
tunnel
@@ -25,13 +25,11 @@ echo "$url" | grep "$appname" | grep -q predix.io || { echo "URL doesn't look sa
25
26
# If there's an existing client running, kill it
27
if [ -r "$pidfile" ]; then
28
- kill $(cat "$pidfile") 2>/dev/null
29
- rm "$pidfile"
30
-fi
+ pid=$(cat "$pidfile")
31
32
-client_pids=`ps auxww | grep ./chisel | grep ${CHISEL_LOCAL_PORT}:${CHISEL_REMOTE_PORT} | grep -v grep | awk '{print $2}'`
33
-if [ -n "$client_pids" ]; then
34
- kill $client_pids
+ # Note ps will exit non-0 if $pid isn't running
+ ps -p $pid | grep -q chisel && kill $pid
+ rm "$pidfile"
35
fi
36
37
echo "Starting client, connecting to $url"
0 commit comments