#!/bin/sh

set -e
VPNGRP=GMI-All
VPNUSER=danny.milosavljevic
VPNURL=https://vpn.gmi.oeaw.ac.at/
VPNCD="/gnu/store/liyl08r46js51fypcqblnbqzjflxm1n8-vpnc-0.5.3/"

openvpn --mktun --dev tun1
ifconfig tun1 up
/root/.guix-profile/sbin/openconnect -s "${VPNCD}/etc/vpnc/vpnc-script" "${VPNURL}" --user="${VPNUSER}" --authgroup="${VPNGRP}" --interface=tun1
ifconfig tun1 down

