aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-switches.pl
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2015-03-31 05:09:33 +0200
committerJoachim Tingvold <joachim@tingvold.com>2015-03-31 05:09:33 +0200
commit381e194162092e6ca6d1da2248a41af8b4f7208d (patch)
tree224c1f7003a1ff3f9a5f4d844c1bea3c86f88958 /tools/make-switches.pl
parent191df1949e2e05eb20b49d5cb31afc7a1f70da91 (diff)
parente3d7c5cc86fedb458d9b091ca12245c01e7f285d (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'tools/make-switches.pl')
-rwxr-xr-xtools/make-switches.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/make-switches.pl b/tools/make-switches.pl
index a2f5d22..beb4343 100755
--- a/tools/make-switches.pl
+++ b/tools/make-switches.pl
@@ -2,7 +2,7 @@
use strict;
use warnings;
-my $switchtype = "dlink3100";
+my $switchtype = "ex2200";
print "begin;\n";
print "delete from temppoll;\n";
@@ -22,8 +22,10 @@ while (<STDIN>) {
}
my $name = $info[0];
- my $range = $info[3];
- my $ip = $info[4];
+ 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";