Created
January 13, 2014 23:39
-
-
Save anonymous/8410192 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
token="<TOKEN TEXT HERE>" | |
config=$(pwd)/cryptostorm.conf | |
passfile=$(pwd)/cryptostorm_pass.txt | |
config_url="https://cryptostorm.org/download/file.php?id=594" | |
# create sha512 sum username | |
username=$(echo -n "$token"| sha512sum | cut -d ' ' -f 1) | |
# save it into a local file for openvpn to read | |
echo "$username" > "$passfile" && chmod 0755 "$passfile" | |
wget -o /dev/null -O "$config" $config_url | |
# fixup the configuration to use our token | |
sed -i \ | |
-e "s@auth-user-pass\(.*\)@auth-user-pass ${passfile}@" \ | |
-e "s@devnull.txt@/dev/null@" \ | |
$config | |
openvpn --config $config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment