3 # agnclient CLI version
4 # This is more or less a re-write of NetVPN.sh to be more multi-user
5 # friendly, and more debian-like with the way it discovers things.
7 # David Zanetti <dzanetti@nz1.ibm.com> 20080115
9 .
/etc
/default
/agnclient
11 if [ -z "${SMX_ADDRESS}" ]; then
12 echo "Please define SMX_ADDRESS in /etc/default/agnclient"
16 if [ -f ~
/.agncli
]; then
20 if [ -z "${NETVPN_ACCOUNT}" ] ||
[ -z "${NETVPN_USERNAME}" ] \
21 ||
[ -z "${NETVPN_PASSWORD}" ]; then
22 echo "Please define NETVPN_ACCOUNT, NETVPN_USERNAME, and NETVPN_PASSWORD in"
23 echo "either /etc/default/agnclient or ~/.agncli"
27 VPNCLIENT
=/opt
/agns
/bin
/vpnCLI
29 if [ ! -x ${VPNCLIENT} ]; then
30 echo "Cannot execute VPN client binaries, broken packages?"
35 if [ -n "${HTTP_PROXY}" ]; then
36 if [ -n "${HTTP_PROXY_AUTH}" ]; then
37 $PROXY="${HTTP_PROXY} ${HTTP_PROXY_AUTH}"
39 $PROXY="${HTTP_PROXY}"
43 # export various things into the environment
44 export NETVPN_ACCOUNT NETVPN_USERNAME NETVPN_PASSWORD
46 echo "Using ${NETVPN_ACCOUNT}/${NETVPN_USERNAME} login"
48 # Actually invoke client
49 exec ${VPNCLIENT} ${SMX_ADDRESS} ${PROXY}