Fix bashism/non-POSIX usage of $UID.
[grml-network.git] / sbin / grml-vpnc-tugraz
index de34977..0fc6bf3 100755 (executable)
@@ -1,10 +1,9 @@
-#!/bin/sh
+#!/bin/bash
 # Filename:      grml-vpnc-tugraz
 # Purpose:       connect via vpnc in VC-Graz/TU Graz (www.vc-graz.ac.at / www.tugraz.at)
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Sam Jän 26 00:12:37 CET 2008 [mika]
 ################################################################################
 
 # Documentation:
 export LANG=C
 export LC_ALL=C
 
-if [ "$UID" != 0 ];  then
+if [ $(id -ru) -ne 0 ] ; then
   sudo $0
   exit
 fi
 
-function typeofservice() {
+typeofservice() {
 NETWORK=$(dialog --stdout --clear --title "foobar" --menu \
 "This script is a submenu of grml-network to set up an internet connection