summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh')
-rwxr-xr-xconfig/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh
index 31400ea..bbafbfc 100755
--- a/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh
+++ b/config/chroot_local-includes/etc/NetworkManager/dispatcher.d/20-time.sh
@@ -100,9 +100,17 @@ wait_for_tor_consensus() {
}
wait_for_working_tor() {
- log "Waiting for Tor to be working (i.e. cached descriptors exist)..."
+ local waited=0
+
+ log "Waiting for Tor to be working..."
while ! tor_is_working; do
- inotifywait -q -t ${INOTIFY_TIMEOUT} -e close_write -e moved_to ${TOR_DIR} || log "timeout"
+ if [ "$waited" -lt ${INOTIFY_TIMEOUT} ]; then
+ sleep 2
+ waited=$(($waited + 2))
+ else
+ log "Timed out waiting for Tor to be working"
+ return 1
+ fi
done
log "Tor is now working."
}