Created
July 14, 2018 04:51
-
-
Save Mehran/797816c620c87f706107095ee14a95ae to your computer and use it in GitHub Desktop.
IKEV2 Automation
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 characters
#!/bin/bash | |
### Author ### | |
# By : Mehran Goudarzi | |
# Release : 2018-06-24 | |
# Description : IKEV2 Auto Creator | |
# Version : 1.1 | |
############### | |
### Colors #### | |
BRed="\033[1;31m" | |
BGreen="\033[1;32m" | |
BYellow="\033[1;33m" | |
BBlue="\033[1;34m" | |
BPurple="\033[1;35m" | |
BWhite="\033[1;37m" | |
NC='\033[0m' # No Color | |
################### | |
# Download Docker | |
printf "$BGreen[+]Updating package ...$NC\n" | |
sudo apt update && sudo apt install docker.io -y > /dev/null 2>&1. | |
printf "$BGreen[+]Downloading IKEv2 docker ...$NC\n" | |
sudo docker run --privileged -d --name ikev2-vpn-server --restart=always -p 500:500/udp -p 4500:4500/udp gaomd/ikev2-vpn-server:0.3.0 > /dev/null 2>&1 | |
printf "$BGreen[+]Extract IKEv2 confige file ...$NC\n" | |
sudo docker run --privileged -i -t --rm --volumes-from ikev2-vpn-server -e "HOST=vip.mehran.co" gaomd/ikev2-vpn-server:0.3.0 generate-mobileconfig > mehran-ikev2.mobileconfig | |
sudo sed -i -e 's/My/Mehran/g' /root/mehran-ikev2.mobileconfig | |
# Send Confige file to Telegram | |
curl -F chat_id="XXXXXX" -F document=@"/root/mehran-ikev2.mobileconfig" https://api.telegram.org/botXXXXXXXX/sendDocument > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment