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