aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-accesspoints.pl
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-03-27 08:27:17 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-03-27 08:27:17 +0200
commit1d2470a411e5eaac7e5a1c5d5b6b81e92c92f4a8 (patch)
tree54b901757b088d54d33e70f28a6203383b4dc844 /tools/make-accesspoints.pl
parent0a230ac5481b9518abc64181dbbb4509d83c0b89 (diff)
parent96a9bb4c42f4b53020302fea2a46e734c61c0319 (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'tools/make-accesspoints.pl')
-rwxr-xr-xtools/make-accesspoints.pl24
1 files changed, 0 insertions, 24 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;
-}