improve pid tor check
This commit is contained in:
parent
89a254cd79
commit
7634cffcb8
@ -15,7 +15,12 @@ EOF
|
|||||||
while :; do
|
while :; do
|
||||||
checkurl=$(curl --socks5 "localhost:${TOR_PORT:-9050}" -o /dev/null -s -w "%{http_code}\n" "${URL_CHECK:-https://www.youtube.com/results?search_query=rms}")
|
checkurl=$(curl --socks5 "localhost:${TOR_PORT:-9050}" -o /dev/null -s -w "%{http_code}\n" "${URL_CHECK:-https://www.youtube.com/results?search_query=rms}")
|
||||||
if [ "$checkurl" = '502' ] || [ "$checkurl" = '302' ]; then
|
if [ "$checkurl" = '502' ] || [ "$checkurl" = '302' ]; then
|
||||||
pkill tor && tor -f /etc/tor/torrc --runasdaemon 1
|
if pgrep tor > /dev/null; then
|
||||||
|
pkill tor > /dev/null
|
||||||
|
tor -f /etc/tor/torrc --runasdaemon 1
|
||||||
|
else
|
||||||
|
tor -f /etc/tor/torrc --runasdaemon 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user