Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Added flags for --tor-connect and --secure-core-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
mazen160 committed Sep 22, 2018
1 parent 87f4243 commit d55d38e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions protonvpn-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,28 @@ function connect_to_fastest_p2p_vpn() {
openvpn_connect "$config_id" "$selected_protocol"
}

function connect_to_fastest_tor_vpn() {
check_if_profile_initialized
check_if_openvpn_is_currently_running
check_if_internet_is_working_normally

echo "Fetching ProtonVPN servers..."
config_id=$(get_fastest_vpn_connection_id "TOR")
selected_protocol="udp"
openvpn_connect "$config_id" "$selected_protocol"
}

function connect_to_fastest_secure_core_vpn() {
check_if_profile_initialized
check_if_openvpn_is_currently_running
check_if_internet_is_working_normally

echo "Fetching ProtonVPN servers..."
config_id=$(get_fastest_vpn_connection_id "SECURE_CORE")
selected_protocol="udp"
openvpn_connect "$config_id" "$selected_protocol"
}

function connect_to_random_vpn() {
check_if_profile_initialized
check_if_openvpn_is_currently_running
Expand Down Expand Up @@ -1054,6 +1076,8 @@ json_parsed_response = json.loads("""$response_output""")
all_features = {"SECURE_CORE": 1, "TOR": 2, "P2P": 4, "XOR": 8, "IPV6": 16}
excluded_features_on_fastest_connect = ["TOR"]
required_features = ["$required_feature"] if "$required_feature" in all_features else []
if "TOR" in required_features:
excluded_features_on_fastest_connect.remove("TOR")
candidates_1 = []
for _ in json_parsed_response["LogicalServers"]:
Expand Down Expand Up @@ -1166,6 +1190,8 @@ function help_message() {
echo " -l, --last-connect Connect to the previously used ProtonVPN server."
echo " -f, --fastest-connect Connect to the fastest available ProtonVPN server."
echo " -p2p, --p2p-connect Connect to the fastest available P2P ProtonVPN server."
echo " -tor, --tor-connect Connect to the fastest available ProtonVPN TOR server."
echo " -sc, --secure-core-connect Connect to the fastest available ProtonVPN SecureCore server."
echo " -cc, --country-connect Select and connect to a ProtonVPN server by country."
echo " -cc [country-name] [protocol] Connect to the fastest available server in a specific country."
echo " -d, --disconnect Disconnect the current session."
Expand Down Expand Up @@ -1201,6 +1227,10 @@ case $user_input in
;;
"-p2p"|"--p2p"|"-p2p-connect"|"--p2p-connect") connect_to_fastest_p2p_vpn
;;
"-tor"|"--tor"|"-tor-connect"|"--tor-connect") connect_to_fastest_tor_vpn
;;
"-sc"|"--sc"|"-secure-core-connect"|"--secure-core-connect") connect_to_fastest_secure_core_vpn
;;
"-cc"|"--cc"|"-country-connect"|"--country-connect")
if [[ $# == 1 ]]; then
connection_to_vpn_via_dialog_menu "countries"
Expand Down

0 comments on commit d55d38e

Please sign in to comment.