Procházet zdrojové kódy

improved tunnel stuff

Gamaliel Espinoza před 7 roky
rodič
revize
5f076815b1
1 změnil soubory, kde provedl 8 přidání a 14 odebrání
  1. 8 14
      fourier_install.sh

+ 8 - 14
fourier_install.sh

@@ -69,20 +69,6 @@ curl -X POST -F "key=$keycontent" \
 	 -H "Authorization: $BOX_ID $API_SECRET" \
 	 https://api.audiovalid.com/public-key
 
-# echo -e "\e[33mPlease add the following public key to server's authorized keys:\e[0m"
-# cat $keyfile.pub
-# read -p "Press enter to continue"
-
-if [[ "$OSTYPE" != darwin* ]]; then
-	echo "/usr/bin/autossh -N -f -M 7$PORT -oPubkeyAuthentication=yes -oPasswordAuthentication=no -oLogLevel=error  -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i $keyfile -R 6$PORT:localhost:22 $tunnel_user@$serverhost -p 22" > $tunnelfile
-	sudo mv $installerpath/ssh-tunnel.service /etc/systemd/system/ssh-tunnel.service
-
-	sudo systemctl enable ssh-tunnel
-	sudo systemctl start ssh-tunnel
-	# read -p "que pasa aqui"
-fi
-
-
 if [[ "$OSTYPE" == darwin* ]]; then
 	depend=( python gcc vim tmux autossh lame nodejs \
 			 ezstream libusb rtl-sdr portaudio )
@@ -190,6 +176,14 @@ fi
 			startup systemd -u fourier \
 			--hp ~/
 	fi
+
+if [ ! -f "/etc/systemd/system/ssh-tunnel.service" ]; then
+	echo "/usr/bin/autossh -N -f -M 7$PORT -oPubkeyAuthentication=yes -oPasswordAuthentication=no -oLogLevel=error  -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i $keyfile -R 6$PORT:localhost:22 $tunnel_user@$serverhost -p 22" > $tunnelfile
+	sudo mv $installerpath/ssh-tunnel.service \
+			/etc/systemd/system/ssh-tunnel.service
+	sudo systemctl enable ssh-tunnel
+	sudo systemctl start ssh-tunnel
+fi
 	
 if [[ "$OSTYPE" != darwin* ]]; then
 	sudo mysql -u root -e "create database $mysql_db;"