Created
March 16, 2017 10:21
-
-
Save kodekracker/6eb5c90c8b7f28da594767d7499fdad8 to your computer and use it in GitHub Desktop.
Revisions
-
kodekracker created this gist
Mar 16, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash ################################################ # A SIMPLE SCHEDULE IP CHANGE SCRIPT FOR LINUX # # MAKE SURE YOU HAVE RUN hma-udp-grabber.sh # ################################################ OPENVPNCONFIG_PATH="/etc/openvpn" while true do openvpn --daemon --config ${OPENVPNCONFIG_PATH}/Afghanistan.Kabul.TCP.ovpn # <<<< change the config file string to match your prefered server echo "#####################" echo "Press CTRL+C to stop." echo "#####################" sleep 60 # <<<< wait for connection to be established # do something here killall openvpn # <<<< disconnect sleep 30 # <<<< wait a bit more to make sure that the openvpn has been properly disconnected done # ----------- NOTE ----------- # # IT'S NOT ADVISABLE TO SWITCH THE IP FASTER THAN 4 - 5 MINUTES WHEN RUNNING # # THIS SCRIPT ON TWO COMPUTERS AT THE SAME TIME; WHEN RUNNING ON A SINGLE # # COMPUTER YOU CAN CHANGE THE IP AS FAST AS 2 MINUTES AND 30 SECONDS. # done