linux - Bash shell commanding to vpn connection from command line -
i trying write bash shell (very first time) can auto connect vpn server. have never written bash script before. can tell me command syntax need this?
#!/bin/bash echo "hi connect vpn labs? yes or no" sleep 2 read answer $connect = "rdesktop -u offsec -p ******** 192.168.***.***" if $ answer != "no" $connect else exit
for right command connect vpn, read following. https://askubuntu.com/questions/57339/connect-disconnect-from-vpn-from-the-command-line.
first, run in terminal , see if works. rdesktop -u offsec -p ******** 192.168.***.***"
then want watch syntax bash script.
#!/usr/bin/env bash read -e -p "hi connect vpn labs? yes or no " answer sleep 2 if [ $answer != "no" ]; rdesktop -u offsec -p ******** 192.168.***.*** else exit fi
Comments
Post a Comment