aboutsummaryrefslogtreecommitdiffstats
path: root/tools/make-switches.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-switches.pl
parent0a230ac5481b9518abc64181dbbb4509d83c0b89 (diff)
parent96a9bb4c42f4b53020302fea2a46e734c61c0319 (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'tools/make-switches.pl')
-rwxr-xr-xtools/make-switches.pl36
1 files changed, 0 insertions, 36 deletions
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";