2 # Filename: grml-vpnc-tugraz
3 # Purpose: connect via vpnc in VC-Graz/TU Graz (www.vc-graz.ac.at / www.tugraz.at)
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
10 # http://www.zid.tugraz.at/ki/netz/extern/vpn/
15 if [ "$UID" != 0 ]; then
21 NETWORK=$(dialog --stdout --clear --title "foobar" --menu \
22 "This script is a submenu of grml-network to set up an internet connection
24 Notice if you want to connect to WLAN at TU Graz:
25 Make sure you have a connection to the access point and an ip-address.
26 Run 'iwconfig \$DEVICE essid tug ; dhclient \$DEVICE'." 0 0 0 \
27 "WLAN" "Connect via WLAN to TU Graz network" \
28 "VCGraz" "Connect to VC-Graz (not yet tested - use grml-pptp-vcgraz!)" \
29 "External" "External connection (not yet tested!)" \
30 "Exit" "Exit this program")
36 if [ $NETWORK == WLAN ]; then
39 ACCOUNT='Account information - your TUGOnline username'
42 if [ $NETWORK == VCGraz ]; then
44 ACCOUNT='Account information - your account number'
47 if [ $NETWORK == External ]; then
49 ACCOUNT='Account information - account number'
53 echo "Cancel pressed." ; exit
56 echo "ESC pressed." ; exit
62 echo "# vpnc at $NETWORK" > /etc/vpnc/vpnctugraz.conf
66 Perfect Forward Secrecy dh2
67 IPSec gateway $GATEWAY
70 # Rekeying interval 21600
71 Xauth username $ACCOUNTNAME
72 Xauth password $PASSWORD
74 " >> /etc/vpnc/vpnctugraz.conf
76 echo -e "#!/bin/sh\nLANG=C\n" > /etc/init.d/vpnctug
77 cat >> /etc/init.d/vpnctug << "EOF"
82 # vpnc /etc/vpnc/vpnctugraz.conf
83 vpnc-connect /etc/vpnc/vpnctugraz.conf
84 # route add default dev tun0
89 /usr/sbin/vpnc-disconnect
94 echo "Usage: /etc/init.d/vpnctug {start|stop}" >&2
102 chmod 600 /etc/vpnc/vpnctugraz.conf
103 chmod +x /etc/init.d/vpnctug
104 /etc/init.d/vpnctug start
108 if [ -z "$ACCOUNTNAME" ] || [ -z "$PASSWORD" ] ; then
109 ACCOUNTNAME=$(dialog --stdout --title "vpnc in $NETWORK" --inputbox "${ACCOUNT}:" 0 0) || exit 0
110 PASSWORD=$(dialog --stdout --title "vpnc in $NETWORK" --passwordbox "Account password (hidden typing)" 0 40) || exit 0
111 [ -z "$ACCOUNTNAME" ] && exit 1
112 [ -z "$PASSWORD" ] && exit 1
118 ## END OF FILE #################################################################