Last active
May 12, 2018 12:39
-
-
Save GitHub30/bdcb284845b6ec143d0d73dd99d7eeac to your computer and use it in GitHub Desktop.
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
# LinuxのNetwork Interfaceの名前は15文字まで(NICNAMEは11文字まで) | |
set -x \ | |
&& NICNAME=honmachi ACCOUNTNAME=honmachi HUB=DEFAULT USERNAME=username PASSWORD= IP_ADDRESS=10.0.2.15 \ | |
&& vpncmd localhost /SERVER /HUB:$DEFAULT /CMD UserCreate $USERNAME /GROUP:none /REALNAME:none /NOTE:none \ | |
&& vpncmd localhost /SERVER /HUB:$DEFAULT /CMD UserPasswordSet $USERNAME /PASSWORD:$PASSWORD \ | |
&& vpncmd localhost /CLIENT /CMD NicCreate $NICNAME \ | |
&& vpncmd localhost /CLIENT /CMD NicList \ | |
&& vpncmd localhost /CLIENT /CMD AccountCreate $ACCOUNTNAME /SERVER:localhost:443 /HUB:$HUB /USERNAME:$USERNAME /NICNAME:$NICNAME \ | |
&& vpncmd localhost /CLIENT /CMD AccountList \ | |
&& vpncmd localhost /CLIENT /CMD AccountPasswordSet $ACCOUNTNAME /PASSWORD:$PASSWORD /TYPE:standard \ | |
&& vpncmd localhost /CLIENT /CMD AccountStartupSet $ACCOUNTNAME \ | |
&& vpncmd localhost /CLIENT /CMD AccountConnect $ACCOUNTNAME \ | |
&& vpncmd localhost /CLIENT /CMD AccountStatusGet $ACCOUNTNAME \ | |
&& sudo ip addr add $IP_ADDRESS/24 dev vpn_$NICNAME \ | |
&& set +x | |
# Down unnecessary route | |
#sudo ip link set vpn_$NICNAME down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment