9 # Initialize gettext support
14 # Must be set after gettext initialization
18 .
/usr
/local
/lib
/tails-shell-library
/common.sh
19 # Import i2p_has_bootstrapped() and i2p_router_console_is_ready()
20 .
/usr
/local
/lib
/tails-shell-library
/i2p.sh
22 I2P_STARTUP_TIMEOUT
=60
23 # We'll give up once 6 minutes have passed. Even with ridiculously
24 # subpar network conditions I've not seen bootstrapping take longer
26 I2P_BOOTSTRAP_TIMEOUT
=360
29 /usr
/local
/sbin
/tails-notify-user \
30 "`gettext \"I2P failed to start\"`" \
31 "`gettext \"Something went wrong when I2P was starting. Check the logs in /var/log/i2p for more information.\"`"
32 service i2p stop
# clean up, just in case
36 wait_until_i2p_router_console_is_ready
() {
37 wait_until
${I2P_STARTUP_TIMEOUT} i2p_router_console_is_ready
40 notify_router_console_success
() {
41 /usr
/local
/sbin
/tails-notify-user \
42 "`gettext \"I2P's router console is ready\"`" \
43 "`gettext \"You can now access I2P's router console on http://127.0.0.1:7657.\"`"
47 /usr
/local
/sbin
/tails-notify-user \
48 "`gettext \"I2P is not ready\"`" \
49 "`gettext \"Eepsite tunnel not built within six minutes. Check the router console at http://127.0.0.1:7657/logs or the logs in /var/log/i2p for more information. Reconnect to the network to try again.\"`"
53 wait_until_i2p_has_bootstrapped
() {
54 wait_until
${I2P_BOOTSTRAP_TIMEOUT} i2p_has_bootstrapped
57 notify_bootstrap_success
() {
58 /usr
/local
/sbin
/tails-notify-user \
59 "`gettext \"I2P is ready\"`" \
60 "`gettext \"You can now access services on I2P.\"`"
66 wait_until_i2p_router_console_is_ready || startup_failure
67 notify_router_console_success
68 wait_until_i2p_has_bootstrapped || bootstrap_failure
69 notify_bootstrap_success
75 echo "invalid argument '${1}'" >&2