summaryrefslogtreecommitdiffstats
path: root/ksirc/KSOpenkSirc/convert-mIRC
blob: 85550dd37ce44bbc30eba0e68d83be978b281023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

while ($line = <STDIN>) {
  if ($line =~ /.*=(Random .*)SERVER:(.*):(.*)GROUP:.*/) {
    $service = 'Random';
    $servername = $1;
    $server = $2;
    $ports = $3;
    print "$service\:$servername\:$server\:$ports\:\n";
  }
  elsif ($line =~ /.*=(.*): (.*)SERVER:(.*):(.*)GROUP:.*/) {
    $service = $1;
    $servername = $2;
    $server = $3;
    $ports = $4;
   
    print "$service\:$servername\:$server\:$ports\:\n";
  } 
}