Skip to content

Instantly share code, notes, and snippets.

@palashkulsh
Last active July 19, 2018 16:03
Show Gist options
  • Save palashkulsh/eac1fae4acf8929868a116d90f62a456 to your computer and use it in GitHub Desktop.
Save palashkulsh/eac1fae4acf8929868a116d90f62a456 to your computer and use it in GitHub Desktop.
#to get id of vpn run
#nmcli con
#!/bin/bash
if [ "$1" = 'd' ];
then
nmcli con down id VPN_USERNAME > /dev/null &
else
echo 'vpn.secrets.password':`oathtool --base32 --totp "SECRET"`>/tmp/pwd && nmcli con up id VPN_USERNAME passwd-file /tmp/pwd >/dev/null &
fi
@palashkulsh
Copy link
Author

for mac users
#install tunnelblickctl if not already present and add following in your bashrc file
alias con='tunnelblickctl connect YOUR_USER'

#download oathtool and pbcopy
#now find the secret key
#tr is required because oathtool gives otp with newline which is also copied with pbcopy

oathtool --base32 --totp "SECRET" | tr -d '\n' | pbcopy && tunnelblickctl connect YOUR_VPN_USERNAME

@rohitprajapati
Copy link

Download link for mac -

tunnelblickctl -
wget https://github.com/benwebber/tunnelblickctl/releases/download/v0.1.0/tunnelblickctl-0.1.0-x86_64-apple-darwin.tar.gz

oathtool -
brew install oath-toolkit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment