Skip to content
Snippets Groups Projects
Select Git revision
  • 0089cea975e0005b7fd28ac1774a17fb01417b96
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

layout.ts

Blame
  • registerReceiver.pl 3.39 KiB
    #!/usr/bin/perl -w
    #
    # registerReceiver.pl
    #
    # Copyright (C) 2011-2012 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.
    
    use strict;
    use Getopt::Std;
    use Switch;
    use File::Basename;
    
    our $VERSION = "2.0";
    
    my $warden_path = '/opt/warden-server';
    require $warden_path . '/lib/WardenReg.pm';
    my $filename = basename($0);
    
    #-------------------------------------------------------------------------------
    #                               Functions
    #-------------------------------------------------------------------------------
    sub usage {
      print "Usage: $filename [-h -o -n <hostname> -r <requestor> -t <type> -i <ip_net_client>]\n";
      exit 1;
    }
    
    
    sub help {
      print "$filename [-h -o -n <hostname> -r <requestor> -t <type> -i <ip_net_client>]\n";
      print "-h     print this text and exit\n";
      print "-n     hostname of receiver\n";
      print "-r     client registration requestor\n";
      print "-t     type of received events or '_any_' for receiving of all types of events\n";
      print "-o     enable receiving of own events\n";
      print "-i     CIDR of receiver\n";
      exit 0;
    }
    
    
    #-------------------------------------------------------------------------------
    # errMsg - print error message and die
    #-------------------------------------------------------------------------------
    sub errMsg
    {
      my $msg = shift;
      $msg = trim($msg);
      print $msg . "\n";
      exit 1;
    } # End of errMsg
    
    
    #-------------------------------------------------------------------------------
    # trim - remove whitespace from the start and end of the string
    #-------------------------------------------------------------------------------
    sub trim
    {
      my $string = shift;
      $string =~ s/^\s+//;
      $string =~ s/\s+$//;
      return $string;
    } # End of trim
    
    
    #-------------------------------------------------------------------------------
    #                               MAIN
    #-------------------------------------------------------------------------------
    our ($opt_n, $opt_r, $opt_t, $opt_o, $opt_i, $opt_h);
    
    if ($#ARGV == -1) {usage}