remove leading 0 from ssids on login
[spider.git] / perl / console.pl
index 7e725029b0fb79919dcf7dfda141aef98b2f3602..3ad62001253fc2f8e6b97103287d186749820a41 100755 (executable)
@@ -27,8 +27,6 @@ BEGIN {
        $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
 }
 
-$clusteraddr = '127.0.0.1';
-$clusterport = 27754;
 
 use Mojo::IOLoop;
 
@@ -51,6 +49,9 @@ use Console;
 # initialisation
 #
 
+$clusteraddr //= '127.0.0.1';
+$clusterport //= 27754;
+
 $call = "";                     # the callsign being used
 $node = "";                     # the node callsign being used
 $conn = 0;                      # the connection object for the cluster
@@ -533,10 +534,11 @@ $call = uc shift @ARGV if @ARGV;
 $call = uc $myalias unless $call;
 $node = uc $mycall unless $node;
 
+$call = normalise_call($call);
 my ($scall, $ssid) = split /-/, $call;
 $ssid = undef unless $ssid && $ssid =~ /^\d+$/;  
 if ($ssid) {
-       $ssid = 15 if $ssid > 15;
+       $ssid = 99 if $ssid > 99;
        $call = "$scall-$ssid";
 }