Commit 53852ced authored by Tails developers's avatar Tails developers
Browse files

Be more intelligent when waiting for Tor to restart.

parent b07d1e26
...@@ -118,8 +118,14 @@ maybe_restart_tor () { ...@@ -118,8 +118,14 @@ maybe_restart_tor () {
# Tor from bootstrapping, and a restart is the fastest way to get # Tor from bootstrapping, and a restart is the fastest way to get
# wheels turning) # wheels turning)
if ! tor_is_working; then if ! tor_is_working; then
service tor restart 2>/dev/null if ! service tor restart 2>/dev/null; then
until nc -z localhost 9051 2>/dev/null; do sleep 1; done error "`gettext \"Failed to restart Tor.\"`"
fi
local counter=0
until [ "${counter}" -ge 10 ] || nc -z localhost 9051 2>/dev/null; do
sleep 1
counter=$((${counter}+1))
done
/etc/NetworkManager/dispatcher.d/60-vidalia.sh clearnet up 2>/dev/null /etc/NetworkManager/dispatcher.d/60-vidalia.sh clearnet up 2>/dev/null
fi fi
} }
......
Markdown is supported
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