Subversion Repositories sysadmin_scripts

Rev

Rev 175 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 175 Rev 176
Line 194... Line 194...
194
sub startConnection {
194
sub startConnection {
195
   my $destination = shift;
195
   my $destination = shift;
196
   my $exitString = 'Unknown Exit Status';
196
   my $exitString = 'Unknown Exit Status';
197
   my $configFile = "$configDirs/$destination/$destination.ovpn";
197
   my $configFile = "$configDirs/$destination/$destination.ovpn";
198
   my $p12 =  "$configDirs/$destination/$destination.p12";
198
   my $p12 =  "$configDirs/$destination/$destination.p12";
199
   return '' unless -f "$configDirs/$destination"; # they did not give a known configuration
199
   return '' unless -d "$configDirs/$destination"; # they did not give a known configuration
200
   chdir( "$configDirs/$destination" ) if $chdir;
200
   chdir( "$configDirs/$destination" ) if $chdir;
201
   if ( -f $configFile ) {
201
   if ( -f $configFile ) {
202
      # we found the config file
202
      # we found the config file
203
      if ( &getPid( $destination ) ) { # make sure it is not already running
203
      if ( &getPid( $destination ) ) { # make sure it is not already running
204
         return 'The connection was already active';
204
         return 'The connection was already active';