diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2016-03-25 15:23:08 +0100 |
---|---|---|
committer | Joachim Tingvold <joachim@tingvold.com> | 2016-03-25 15:23:08 +0100 |
commit | 519bae0f07f38bd82257c61a924085f64ad360cc (patch) | |
tree | d249ad5957cc3698db40df972c5a60d37679abea /tools | |
parent | 14dbbc1451b4d5ea99e1937020e4fc79fe7ba1a7 (diff) |
Moved old, unused files.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/make-accesspoints.pl | 24 | ||||
-rwxr-xr-x | tools/make-switches.pl | 36 |
2 files changed, 0 insertions, 60 deletions
diff --git a/tools/make-accesspoints.pl b/tools/make-accesspoints.pl deleted file mode 100755 index b84321a..0000000 --- a/tools/make-accesspoints.pl +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/perl -use strict; -use warnings; - -while (<>) { - my @arr = split " "; - my $ap = 'ap-'.$arr[0]; - my $core = $arr[1]; - # Trekk fra 1 - $core =~ s/^(distro)(\d+)$/$1.($2-1)/e; - - # Fjerde kabel er aksesspunkt - my $blade; - my $port; - if ($arr[5] =~ /^Gi(\d+)\/(\d+)$/) { - $blade = $1; - $port = $2; - } else { - die "Unknown port: ".$arr[5]; - } - printf "INSERT INTO switches(ip, sysname, switchtype) values(inet '127.0.0.1', '%s', 'ciscoap');\n", $ap; - printf "INSERT INTO uplinks SELECT (SELECT switch FROM switches WHERE sysname = '%s') AS switch, (SELECT switch FROM switches WHERE sysname = '%s') AS coreswitch, %d AS blade, %d AS port;\n", $ap, $core, $blade, $port; - printf "INSERT INTO ap_poll(switch) SELECT switch FROM switches WHERE sysname = '%s';\n", $ap; -} diff --git a/tools/make-switches.pl b/tools/make-switches.pl deleted file mode 100755 index c0c842a..0000000 --- a/tools/make-switches.pl +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/perl - -use strict; -use warnings; - -my $switchtype = "ex2200"; - -print "begin;\n"; -print "delete from temppoll;\n"; -print "delete from dhcp;\n"; -print "delete from switches where switchtype = '$switchtype';\n"; -#print "SELECT pg_catalog.setval('switches_switch_seq', 1, false);\n"; -print "SELECT pg_catalog.setval('polls_poll_seq', 1, false);\n"; - -my %ip; -my $i = 1; -while (<STDIN>) { - chomp; - my @info = split(/ /); - - if (scalar @info < 5) { - die "Unknown line: $_"; - } - - my $name = $info[0]; - my $range = $info[1]; - my $ip = $info[3]; - $ip =~ s/\/.*$//; - - - print "insert into switches (ip, sysname, switchtype) values ('$ip', '$name', '$switchtype');\n"; - print "insert into dhcp select switch, '$range' from switches where sysname = '$name';\n"; -} -close HOSTS; - -print "end;\n"; |