Added wandows.py and nm-vpn-pool.
parent
ca45310385
commit
131b9178e8
@ -0,0 +1,51 @@
|
|||||||
|
#!/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
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/python2
|
||||||
|
import binascii
|
||||||
|
import sys
|
||||||
|
import string
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
for pos, eachChar in enumerate(line, 1):
|
||||||
|
if pos % 4 == 0:
|
||||||
|
if eachChar in string.ascii_letters:
|
||||||
|
sys.stdout.write(binascii.unhexlify(hex(int(binascii.hexlify(eachChar), 16) & 119)[2:]))
|
||||||
|
else:
|
||||||
|
sys.stdout.write(eachChar)
|
||||||
|
else:
|
||||||
|
sys.stdout.write(eachChar)
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stdout.write('\n')
|
||||||
Loading…
Reference in New Issue