From c4b2822abfc3b6a3440b5bf82a1316bcd2b77685 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 May 2016 11:20:11 +0100 Subject: [PATCH] Option to enable monkeysphere on the client --- src/freedombone-client | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/freedombone-client b/src/freedombone-client index 9b0280cb..d9cbb217 100755 --- a/src/freedombone-client +++ b/src/freedombone-client @@ -33,6 +33,7 @@ export TEXTDOMAINDIR="/usr/share/locale" CURR_USER=$USER MESH_CLIENT_INSTALL= +ENABLE_MONKEYSPHERE= # Version number of this script VERSION="1.01" @@ -122,12 +123,18 @@ function configure_ssh_client { echo 'Host *.onion' > ~/.ssh/config echo ' ServerAliveInterval 60' >> ~/.ssh/config echo ' ServerAliveCountMax 3' >> ~/.ssh/config - echo " ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config + if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then + echo " ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'" >> ~/.ssh/config + else + echo " ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config + fi echo "# ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'" >> ~/.ssh/config echo 'Host *' >> ~/.ssh/config echo ' ServerAliveInterval 60' >> ~/.ssh/config echo ' ServerAliveCountMax 3' >> ~/.ssh/config - echo '# ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config + if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then + echo ' ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config + fi echo '' echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server' @@ -143,7 +150,7 @@ function configure_monkeysphere { function show_help { echo '' - echo $"${PROJECT_NAME}-client --mesh [yes|no]" + echo $"${PROJECT_NAME}-client --mesh [yes|no] --monkeysphere [yes|no]" echo '' exit 0 } @@ -164,10 +171,14 @@ do shift WIFI_CHANNEL=${1} ;; - --mesh) + -m|--mesh) shift MESH_CLIENT_INSTALL=${1} ;; + --monkeysphere|--ms|--monkey) + shift + ENABLE_MONKEYSPHERE=${1} + ;; *) # unknown option ;;