Skip to content

Instantly share code, notes, and snippets.

Created January 13, 2014 23:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8410192 to your computer and use it in GitHub Desktop.
Save anonymous/8410192 to your computer and use it in GitHub Desktop.
#!/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