Commit 36b6f4dd authored by manoj v's avatar manoj v
Browse files

Issue #240 chore: add the openvpn script

No related merge requests found
Showing with 15 additions and 0 deletions
+15 -0
#!/bin/bash
userPassword=$1
#download the packages
cd /tmp
wget -c http://swupdate.openvpn.org/as/openvpn-as-2.1.9-Ubuntu16.amd_64.deb
#install the software
sudo dpkg -i openvpn-as-2.1.9-Ubuntu16.amd_64.deb
#update the password for user openvpn
sudo echo "openvpn:$userPassword"|sudo chpasswd
#configure server network settings
PUBLICIP=$(curl -s ifconfig.me)
sudo apt-get install sqlite3
sudo sqlite3 "/usr/local/openvpn_as/etc/db/config.db" "update config set value='$PUBLICIP' where name='host.name';"
#restart OpenVPN AS service
sudo systemctl restart openvpnas
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment