#!/usr/bin/perl my $client = "/usr/local/sbin/vpnc"; my $profile_dir = "/etc/vpnc"; my @vpn_locations; print "Unix VPN Connection Utility (new and improved!)\n"; print "Available VPN Servers:\n\n"; opendir(DIR, $profile_dir); while (defined(my $location = readdir(DIR))) { if ( $location =~ /\.conf/i) { $location =~ s/.conf$//; push(@vpn_locations, $location); } } closedir(DIR); my $number_of_locations = @vpn_locations; for($i = 0; $i < $number_of_locations; $i++) { $number = $i+1; print "[$number] $vpn_locations[$i]\n"; } print "\nPlease select a VPN to connect to: "; my $entry = ; chomp($entry); print "\nConnecting to " . $vpn_locations[$entry-1] . "...\n"; exec("$client $profile_dir/$vpn_locations[$entry-1]");