Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
66e47006
Commit
66e47006
authored
Sep 01, 2015
by
anonym
Committed by
kytv
Oct 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log Tor's bootstrapping status to syslog.
parent
c9b58900
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
config/chroot_local-includes/usr/local/sbin/restart-tor
config/chroot_local-includes/usr/local/sbin/restart-tor
+6
-0
No files found.
config/chroot_local-includes/usr/local/sbin/restart-tor
View file @
66e47006
...
...
@@ -8,6 +8,10 @@ set -e
# Import tor_bootstrap_progress()
.
/usr/local/lib/tails-shell-library/tor.sh
# Import log()
.
/usr/local/lib/tails-shell-library/log.sh
_LOG_TAG
=
"
$(
basename
$0
)
"
# The Tor log is removed to ensure `tor_bootstrap_progress`'s output will be
# accurate.
clear_tor_log
()
{
...
...
@@ -30,12 +34,14 @@ last_bootstrap_change=$(date +%s)
maybe_restart_tor
()
{
local
new_bootstrap_progress
=
$(
tor_bootstrap_progress
)
if
[
$new_bootstrap_progress
-eq
100
]
;
then
log
"Tor has successfully bootstrapped."
return
0
elif
[
$new_bootstrap_progress
-gt
$bootstrap_progress
]
;
then
bootstrap_progress
=
$new_bootstrap_progress
last_bootstrap_change
=
$(
date
+%s
)
return
1
elif
[
$(
expr
$(
date
+%s
)
-
$last_bootstrap_change
)
-ge
20
]
;
then
log
"Tor seems to have stalled while bootstrapping. Restarting Tor."
clear_tor_log
service tor restart
bootstrap_progress
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment