12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- diff -ru RelativeLink/start-tor-browser RelativeLinkNamecoin/start-tor-browser
- --- RelativeLink/start-tor-browser 2019-09-11 20:17:08.157789097 +0000
- +++ RelativeLinkNamecoin/start-tor-browser 2019-09-15 04:43:02.237434304 +0000
- @@ -169,6 +169,11 @@
- detach=0
- fi
-
- +# We can't detach and enable Namecoin at the same time..
- +if [ "$TOR_ENABLE_NAMECOIN" = 1 -a "$detach" -eq 1 ]; then
- + detach=0
- +fi
- +
- if [ "$show_output" -eq 0 ]; then
- # If the user hasn't requested 'debug mode' or --help, close stdout and stderr,
- # to keep Firefox and the stuff loaded by/for it (including the
- @@ -355,6 +360,41 @@
- #
- # The --class parameter was added to fix bug 11102.
-
- +# The Namecoin support in this script is a placeholder proof-of-concept only.
- +# In the real world this would be moved to Tor Launcher.
- +if [ "${TOR_ENABLE_NAMECOIN}" = 1 ]; then
- + if [ "$show_usage" -eq 1 ]; then
- + # No help exists for Namecoin
- + TOR_ENABLE_NAMECOIN=0
- + elif [ "$detach" -eq 1 ] ; then
- + # No support yet for detached Namecoin
- + TOR_ENABLE_NAMECOIN=0
- + elif [ "$log_output" -eq 1 -a "$show_output" -eq 1 ]; then
- + # No support yet for logging Namecoin
- + TOR_ENABLE_NAMECOIN=0
- + elif [ "$show_output" -eq 1 ]; then
- + # Launch Namecoin in verbose mode
- + echo "Launching Namecoin..."
- + grep --quiet "__LeaveStreamsUnattached 1" TorBrowser/Data/Tor/torrc-defaults || echo "__LeaveStreamsUnattached 1" >> TorBrowser/Data/Tor/torrc-defaults
- + TorBrowser/Electrum-NMC/run_electrum_nmc daemon -v --dir "TorBrowser/Data/Electrum-NMC/" &
- + ELECTRUM_NMC_PID=$!
- + python3 TorBrowser/StemNS/poc.py &
- + STEM_NS_PID=$!
- + echo "Launched Namecoin."
- + else
- + # Launch Namecoin
- + grep --quiet "__LeaveStreamsUnattached 1" TorBrowser/Data/Tor/torrc-defaults || echo "__LeaveStreamsUnattached 1" >> TorBrowser/Data/Tor/torrc-defaults
- + TorBrowser/Electrum-NMC/run_electrum_nmc daemon --dir "TorBrowser/Data/Electrum-NMC/" &
- + ELECTRUM_NMC_PID=$!
- + python3 TorBrowser/StemNS/poc.py &
- + STEM_NS_PID=$!
- + fi
- +fi
- +
- +if [ "${TOR_ENABLE_NAMECOIN}" != 1 ]; then
- + perl -i -p -e 's/__LeaveStreamsUnattached 1\n//' TorBrowser/Data/Tor/torrc-defaults
- +fi
- +
- if [ "$show_usage" -eq 1 ]; then
- # Display Firefox help, then our help
- TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD} ./firefox --class "Tor Browser" \
- @@ -376,4 +416,13 @@
- -profile TorBrowser/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 </dev/null
- fi
-
- -exit $?
- +FIREFOX_EXIT_CODE=$?
- +
- +if [ "${TOR_ENABLE_NAMECOIN}" = 1 ]; then
- + echo "Terminating Namecoin..."
- + kill ${ELECTRUM_NMC_PID}
- + kill -s SIGKILL ${STEM_NS_PID}
- + echo "Terminated Namecoin."
- +fi
- +
- +exit ${FIREFOX_EXIT_CODE}
|