aboutsummaryrefslogtreecommitdiffstats
path: root/core/entrypoint-tor.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-07-29 00:18:16 -0500
committerJesús <heckyel@hyperbola.info>2021-07-29 00:18:16 -0500
commitae37d5106ff855731280834c791b2f4bc684d96c (patch)
tree5fa1db87e134b353a5d6e35d7341448ad282f195 /core/entrypoint-tor.sh
parent2ad12f2ef9380ad41f2f6a00c7b5f59c298c8633 (diff)
downloadyt-local-docker-ae37d5106ff855731280834c791b2f4bc684d96c.tar.lz
yt-local-docker-ae37d5106ff855731280834c791b2f4bc684d96c.tar.xz
yt-local-docker-ae37d5106ff855731280834c791b2f4bc684d96c.zip
improve tor change
Diffstat (limited to 'core/entrypoint-tor.sh')
-rw-r--r--core/entrypoint-tor.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/entrypoint-tor.sh b/core/entrypoint-tor.sh
index 808c2d5..90a49c5 100644
--- a/core/entrypoint-tor.sh
+++ b/core/entrypoint-tor.sh
@@ -13,14 +13,13 @@ EOF
# check loop health tor
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}")
- if [ "$checkurl" = '502' ] || [ "$checkurl" = '302' ]; then
- 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
+ if pgrep tor > /dev/null; then
+ 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
+ pkill tor && tor -f /etc/tor/torrc --runasdaemon 1
fi
+ else
+ tor -f /etc/tor/torrc --runasdaemon 1
fi
sleep 5
done