Skip to content

Instantly share code, notes, and snippets.

@tamirko
Last active April 4, 2016 08:27
Show Gist options
  • Save tamirko/abf929196b0ad1e608d1d01f44f689c9 to your computer and use it in GitHub Desktop.
Save tamirko/abf929196b0ad1e608d1d01f44f689c9 to your computer and use it in GitHub Desktop.
install ravello open_vpn
#!/bin/bash
which openvpn
if [ $? -ne 0 ]; then
# Install openvpn
which yum
if [ $? -ne 0 ]; then
# Install on Ubuntu
sudo apt-get install -y openvpn
else
# Install on CentOs
sudo yum install -y epel-release
sudo yum install -y openvpn
# If you are using Gnome, install next the packages:
# NetworkManager-openvpn NetworkManager-openvpn-gnome
fi
fi
currWorkDir=openVPN_Work_$1
mkdir -p $currWorkDir
pushd $currWorkDir
wget https://s3-eu-west-1.amazonaws.com/gigaspaces-delivery/poc-env/client.tar.gz
tar -xvf client.tar.gz
cd client
cp client.ovpn orig_client.ovpn
jumpNodeIP=$1
sed -i -e "s/<OpenVPN server>/$jumpNodeIP/g" client.ovpn
#ps -ef | grep openvpn | grep -v grep | awk -F" " '{print $2}' | sudo xargs kill -9
sudo openvpn --config client.ovpn
popd
# To Run this from remote, use the following command :
# curl -s FULL_URL_OF_THE_RAW_VERSION_OF_THIS_SCRIPT | bash /dev/stdin IP_ADDRESS_OF_THE_JUMP_NODE
# e.g. :
# curl -s https://gist.githubusercontent.com/tamirko/abf929196b0ad1e608d1d01f44f689c9/raw/b823c0ac80851b502754221be299427f8b9f3d2a/install_ravello_open_vpn.sh | bash /dev/stdin 287.54.321.44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment