Skip to content
Snippets Groups Projects
Commit 283782bf authored by Bob Mottram's avatar Bob Mottram
Browse files

Don't overwrite client ssh config #68

parent f0fb62ea
No related branches found
No related tags found
No related merge requests found
......@@ -162,25 +162,34 @@ function configure_ssh_client {
if [ ! -d ~/.ssh ]; then
mkdir ~/.ssh
fi
echo 'Host *.onion' > ~/.ssh/config
echo ' ServerAliveInterval 60' >> ~/.ssh/config
echo ' ServerAliveCountMax 3' >> ~/.ssh/config
if [ ! -f ~/.ssh/config ]; then
touch ~/.ssh/config
fi
proxycmd="connect -R remote -5 -S 127.0.0.1:9050 %h %p"
if [ -f /usr/bin/pacman ]; then
proxycmd="/usr/bin/nc -X 5 -x 127.0.0.1:9050 %h %p"
fi
if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
echo " ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; $proxycmd'" >> ~/.ssh/config
else
echo " ProxyCommand $proxycmd" >> ~/.ssh/config
fi
echo 'Host *' >> ~/.ssh/config
echo ' ServerAliveInterval 60' >> ~/.ssh/config
echo ' ServerAliveCountMax 3' >> ~/.ssh/config
if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
echo ' ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config
if ! grep -q "# ${PROJECT_NAME} settings" ~/.ssh/config; then
if ! grep -q "Host *.onion" ~/.ssh/config; then
echo "# ${PROJECT_NAME} settings start" >> ~/.ssh/config
echo 'Host *.onion' >> ~/.ssh/config
echo ' ServerAliveInterval 60' >> ~/.ssh/config
echo ' ServerAliveCountMax 3' >> ~/.ssh/config
if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
echo " ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; $proxycmd'" >> ~/.ssh/config
else
echo " ProxyCommand $proxycmd" >> ~/.ssh/config
fi
echo 'Host *' >> ~/.ssh/config
echo ' ServerAliveInterval 60' >> ~/.ssh/config
echo ' ServerAliveCountMax 3' >> ~/.ssh/config
if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
echo ' ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config
fi
echo "# ${PROJECT_NAME} settings end" >> ~/.ssh/config
fi
fi
echo ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment