Browse Source

Option to enable monkeysphere on the client

Bob Mottram 9 years ago
parent
commit
c4b2822abf
1 changed files with 15 additions and 4 deletions
  1. 15
    4
      src/freedombone-client

+ 15
- 4
src/freedombone-client View File

33
 
33
 
34
 CURR_USER=$USER
34
 CURR_USER=$USER
35
 MESH_CLIENT_INSTALL=
35
 MESH_CLIENT_INSTALL=
36
+ENABLE_MONKEYSPHERE=
36
 
37
 
37
 # Version number of this script
38
 # Version number of this script
38
 VERSION="1.01"
39
 VERSION="1.01"
122
 	echo 'Host *.onion' > ~/.ssh/config
123
 	echo 'Host *.onion' > ~/.ssh/config
123
 	echo '  ServerAliveInterval 60' >> ~/.ssh/config
124
 	echo '  ServerAliveInterval 60' >> ~/.ssh/config
124
 	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
125
 	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
125
-	echo "  ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config
126
+	if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
127
+		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
128
+	else
129
+		echo "  ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config
130
+	fi
126
 	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
131
 	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
127
 	echo 'Host *' >> ~/.ssh/config
132
 	echo 'Host *' >> ~/.ssh/config
128
 	echo '  ServerAliveInterval 60' >> ~/.ssh/config
133
 	echo '  ServerAliveInterval 60' >> ~/.ssh/config
129
 	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
134
 	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
130
-	echo '#  ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config
135
+	if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
136
+		echo '  ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config
137
+	fi
131
 
138
 
132
 	echo ''
139
 	echo ''
133
 	echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
140
 	echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
143
 
150
 
144
 function show_help {
151
 function show_help {
145
 	echo ''
152
 	echo ''
146
-	echo $"${PROJECT_NAME}-client --mesh [yes|no]"
153
+	echo $"${PROJECT_NAME}-client --mesh [yes|no] --monkeysphere [yes|no]"
147
 	echo ''
154
 	echo ''
148
 	exit 0
155
 	exit 0
149
 }
156
 }
164
 			shift
171
 			shift
165
 			WIFI_CHANNEL=${1}
172
 			WIFI_CHANNEL=${1}
166
 			;;
173
 			;;
167
-		--mesh)
174
+		-m|--mesh)
168
 			shift
175
 			shift
169
 			MESH_CLIENT_INSTALL=${1}
176
 			MESH_CLIENT_INSTALL=${1}
170
 			;;
177
 			;;
178
+		--monkeysphere|--ms|--monkey)
179
+			shift
180
+			ENABLE_MONKEYSPHERE=${1}
181
+			;;
171
 		*)
182
 		*)
172
 			# unknown option
183
 			# unknown option
173
 			;;
184
 			;;