Project

General

Profile

Bug #17189

Tails Additional Software.OpenVPN Script.

Added by felixbog_l2l about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Accessibility
Target version:
-
Start date:
10/25/2019
Due date:
% Done:

50%

Feature Branch:
Type of work:
Code
Starter:
Affected tool:

Description

Hello friends again, I worked with on my custom build of Tails, & i not get correct restart-tor after tun/tap is opened in OpenVPN script connection. How to check or test to tor_is_bootstrapped & so that Tor is a 100% guaranteed restart, while OpenVPN is hold this connection, into up-script security.
When I started OpenVPN connection,sometimes i get normal connect TOR via OpenVPN, sometimes i get this error:


Job for tor@default.service canceled.
Fri Oct 25 09:09:50 2019 us=692671 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Fri Oct 25 09:09:50 2019 us=692847 Exiting due to fatal error

And I get try to modify restart-tor script into usr/sbin/ Like That:
#!/bin/sh

set -e

# Import try_for()
. /usr/local/lib/tails-shell-library/common.sh

# 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)" 

systemctl restart tor@default.service #Just try to restart Tor_Service_after_tun/tap_connection_is ready
while [ $(try_for 270 '[ "$(tor_bootstrap_progress)" -eq 100 ]') != true ];do sleep 1; done
sleep 10
if try_for 270 '[ "$(tor_bootstrap_progress)" -eq 100 ]'; then
    log "Tor has successfully bootstrapped." 
else
    systemctl kill -f tor@default.service
    systemctl try-restart -f tor@default.service
    if try_for 270 '[ "$(tor_bootstrap_progress)" -eq 100 ]'; then
    log "Tor has successfully bootstrapped." 
    else
    log "Tor failed to bootstrap" 
    exit 1
fi
fi

But sometimes Tor is not has_bootstrapped 100% successfully in time.
My OpenVPN Script.

Tor__ver_OpenVPN.sh View (5.75 KB) felixbog_l2l, 10/25/2019 09:31 AM

Also available in: Atom PDF