diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:32 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:32 +0100 |
commit | cda4d1235486dc74c5d3630fc5e85307f277c5f3 (patch) | |
tree | 0e59890e8afcf09024079d0e3a596e16b63250af /tools/make-accesspoints.pl | |
parent | 004f4efcfd0779f4307b90fed139dc87d01ad0b9 (diff) | |
parent | a791ca16c787672ea534dbde39f926d0341aa2e6 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'tools/make-accesspoints.pl')
-rwxr-xr-x | tools/make-accesspoints.pl | 24 |
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; -} |