Install once only

This commit is contained in:
Bob Mottram 2016-01-25 19:12:32 +00:00
parent 3eed806474
commit 259dbe47b5
1 changed files with 8 additions and 0 deletions

View File

@ -3524,13 +3524,20 @@ function install_tor {
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return return
fi fi
if grep -Fxq "install_tor" $COMPLETION_FILE; then
return
fi
apt-get -y install tor apt-get -y install tor
echo 'install_tor' >> $COMPLETION_FILE
} }
function enable_ssh_via_onion { function enable_ssh_via_onion {
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return return
fi fi
if grep -Fxq "enable_ssh_via_onion" $COMPLETION_FILE; then
return
fi
apt-get -y install tor connect-proxy apt-get -y install tor connect-proxy
if ! grep -q 'Host *.onion' /home/$MY_USERNAME/.ssh/config; then if ! grep -q 'Host *.onion' /home/$MY_USERNAME/.ssh/config; then
if [ ! -d /home/$MY_USERNAME/.ssh ]; then if [ ! -d /home/$MY_USERNAME/.ssh ]; then
@ -3548,6 +3555,7 @@ function enable_ssh_via_onion {
echo 'Host *.onion' >> /root/.ssh/config echo 'Host *.onion' >> /root/.ssh/config
echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /root/.ssh/config echo 'ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p' >> /root/.ssh/config
fi fi
echo 'enable_ssh_via_onion' >> $COMPLETION_FILE
} }
function install_editor { function install_editor {