It requires OpenVPN daemon installed and functions perfectly on Debian Wheezy but could of course work on other Linux systems too, perhaps with some minor modifications to the script.
Notes:
► Show Spoiler
I'm barely a month into learning linux and bash so the script is probably very basic stuff to most of you. Either way I figured I'd share because some members may find it useful and convenient.
I gave it a project name and version because I want to add on a few more functions and I'll throw it up on github if there's any interest in improving or contributing.
Why Breeze, you ask? Because it makes using Cryptostorm a breeze
I gave it a project name and version because I want to add on a few more functions and I'll throw it up on github if there's any interest in improving or contributing.
Why Breeze, you ask? Because it makes using Cryptostorm a breeze

Usage
To hash a token, just paste it as the argument.
- cstorm <token>
► Show Spoiler
Code: Select all
# cstorm Qu84S-e5Dsn-KRylb-2e3H6
f8c3ee4d41200e266d8b6fc90e466e5779cdce2e2a7a0a799861937b7a1466b34a21767e2a5ef544de974dd8019ffb849e063774f10c6636daa974aeaf02f3ee
R
This is the format OpenVPN wants in an auth-user-pass file for login credentials upon connection so you can simply direct the output into a file
Code: Select all
# cstorm Qu84S-e5Dsn-KRylb-2e3H6 >/path/to/.auth-user-pass.file
Remember to change the OpenVPN arguments variable in /etc/default/openvpn to reflect your file location
Code: Select all
# Optional arguments to openvpn's command line
OPTARGS="--auth-user-pass /path/to/.auth-user-pass.file"
To connect to an exit node
- cstorm <country code>
► Show Spoiler
Cryptostorm client config files must be placed in /etc/openvpn/
Valid arguments: cryptofree, dynamic, de, is, uk, fr, pt, ru, ca, mo, wa, sg, jp
Valid arguments: cryptofree, dynamic, de, is, uk, fr, pt, ru, ca, mo, wa, sg, jp
Code: Select all
# cstorm cryptofree
[ ok ] Starting virtual private network daemon: cryptofree_client_linux1-4.
# cstorm jp
[ ok ] Stopping virtual private network daemon: cryptofree_client_linux1-4.
[ ok ] Starting virtual private network daemon: cstorm_linux_tokyo_1-4.
# cstorm uk
[ ok ] Stopping virtual private network daemon: cstorm_linux_tokyo_1-4.
[ ok ] Starting virtual private network daemon: cstorm_linux_london_1-4.
To stop OpenVPN service
- cstorm down
► Show Spoiler
Code: Select all
# cstorm down
[ ok ] Stopping virtual private network daemon: cstorm_linux_london_1-4.
Source:
► Show Spoiler
Code: Select all
#!/bin/bash
breeze_version="1.0"
# #############################################################
# cstorm breeze - an unofficial cryptostorm linux utility
#
# info thread: cryptostorm.org/rest-of-url
#
# obtain your tokens at www.cryptostorm.is (or use cryptofree)
#
# #############################################################
#
# Function to check if openvpn process is running
function check_openvpn {
openvpn_proc="$(pgrep openvpn)"
if [[ -z $openvpn_proc ]]; then
openvpn_status="inactive"
elif [[ -n $openvpn_proc ]]; then
openvpn_status="active"
fi
}
#
# Function to stop active openvpn service and restart with chosen .conf file
function openvpn_start {
check_openvpn
if [[ "$openvpn_status" == "active" ]]; then
/etc/init.d/openvpn stop
fi
/etc/init.d/openvpn start $conf_file
exit
}
#
# Command line argument sets the corresponding .conf file
# Also start openvpn here for an early exit and skip redundance of remaining script
if [[ "$1" == "dynamic" ]] || [[ "$1" == "random" ]] || [[ "$1" == "up" ]]; then
conf_file="cstorm_linux_dynamic_1-4"
openvpn_start
elif [[ "$1" == "is" ]]; then
conf_file="cstorm_linux_iceland_1-4"
openvpn_start
elif [[ "$1" == "de" ]]; then
conf_file="cstorm_linux_frankfurt_1-4"
openvpn_start
elif [[ "$1" == "fr" ]]; then
conf_file="cstorm_linux_paris_1-4"
openvpn_start
elif [[ "$1" == "uk" ]]; then
conf_file="cstorm_linux_london_1-4"
openvpn_start
elif [[ "$1" == "ru" ]]; then
conf_file="cstorm_linux_stpetersburg_1-4"
openvpn_start
elif [[ "$1" == "pt" ]]; then
conf_file="cstorm_linux_lisbon_1-4"
openvpn_start
elif [[ "$1" == "ca" ]]; then
conf_file="cstorm_linux_montreal_1-4"
openvpn_start
elif [[ "$1" == "mo" ]]; then
conf_file="cstorm_linux_uscentral_1-4"
openvpn_start
elif [[ "$1" == "wa" ]]; then
conf_file="cstorm_linux_uswest_1-4"
openvpn_start
elif [[ "$1" == "sg" ]]; then
conf_file="cstorm_linux_singapore_1-4"
openvpn_start
elif [[ "$1" == "jp" ]]; then
conf_file="cstorm_linux_tokyo_1-4"
openvpn_start
elif [[ "$1" == "cryptofree" ]] || [[ "$1" == "free" ]]; then
conf_file="cryptofree_client_linux1_4"
openvpn_start
#
# Command line arguments for ending openvpn process
elif [[ "$1" == "down" ]]; then
/etc/init.d/openvpn stop
exit
elif [[ "$1" == "kill" ]]; then
printf "executing: killall openvpn"
killall openvpn
exit
#
# Command line arguments for displaying loaded config
elif [[ "$1" == "status" ]] || [[ "$1" == "info" ]]; then
printf "cstorm breeze v$breeze_version\n"
check_openvpn
printf "openvpn service is $openvpn_status\n"
if [[ "$openvpn_status" == "active" ]]; then
active_conf=$(/etc/init.d/openvpn status | grep "is running." | awk -F"'" '{print $2}')
printf "loaded config: $active_conf\n"
exit
fi
#
# If token format detected, hash it and add a random alnum char
elif [[ "$1" =~ ^[[:alnum:]]{5}-[[:alnum:]]{5}-[[:alnum:]]{5}-[[:alnum:]]{5}$ ]]; then
printf $1 | sha512sum | awk '{print $1}'
cat /dev/urandom | tr -cd "[:alnum:]" | head -c 1 && printf "\n"
exit
#
# Else if no valid arguments given
else
printf "badd usaeg! no valid argument\n"
exit
fi
exit
Copypaste it into a file, save it as cstorm, make it executable.
Or download the attachment and rename it to cstorm (attachment upload required a file extension)