Commit d97b0527 authored by Peter Palfrader's avatar Peter Palfrader Committed by aagbsn
Browse files

Only try to kill tor if it is our process and it exists

parent f0b02bb4
...@@ -21,9 +21,11 @@ done ...@@ -21,9 +21,11 @@ done
KILLED_TOR=false KILLED_TOR=false
if [ -f "./data/tor/tor.pid" ]; then if [ -f "./data/tor/tor.pid" ]; then
PID=`cat ./data/tor/tor.pid` PID=`cat ./data/tor/tor.pid`
kill $PID if kill -0 "$PID" 2>/dev/null; then # it is a running process and we may send signals to it
if [ $? -eq 0 ]; then kill $PID
KILLED_TOR=true if [ $? -eq 0 ]; then
KILLED_TOR=true
fi
fi fi
fi fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment