#!/bin/bash
#   nm-vpn-pool
#
#   This script chooses a VPN name from a list in /etc/nm-vpn-pool.conf and attempts to
# connect to it when a network is connected. It's intended to automatically rotate through VPNs that
# function as proxies.

source /etc/nm-vpn-pool.conf || exit 1
# Config file should provide:
#   vpn_pool - A comma-delimited list of NetworkManager VPN connection names.
#   default_policy - If set to "on", nm-vpn-pool will attempt to connect to a vpn for all
#                  networks not listed as exceptions. If set to "off", it will only attempt to
#                  connect for networks listed as exceptions.
#   exceptions - A comma-delimited list of NetworkManager networks that do not follow the default
#                policy.

IFS=',' read -r -a vpn_list <<< "${vpn_pool}"

function get_connection_name()
{
    true
}
function switch_vpn_connection()
{
    true
}
function switch_all_vpns_off()
{
    true
}
function get_random_vpn_name()
{
    true
}

action=$1

case $action in
    up)
        true
        ;;
    down)
        true
        ;;
    rotate)
        true
        ;;
    *)
        true
        ;;
esac
