From d596165ea5a110d4e043cbc2775ce888cfd6ae84 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sun, 5 Apr 2015 10:40:01 +0200 Subject: tg15 cleanup --- tools/make-dummy-placement.sh | 12 ++++++++++++ tools/make-switches.pl | 1 + tools/make_dummy_placement.sh | 9 --------- 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100755 tools/make-dummy-placement.sh delete mode 100755 tools/make_dummy_placement.sh (limited to 'tools') diff --git a/tools/make-dummy-placement.sh b/tools/make-dummy-placement.sh new file mode 100755 index 0000000..192e3d3 --- /dev/null +++ b/tools/make-dummy-placement.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Generate a random placement-entry insert for a named switch (convenient +# if you manually add a switch with no placement) + +for a in $* ; do +X=$(( $RANDOM % 500 )) +Y=$(( $RANDOM % 500 )) +X1=$(( $X + 20 )) +Y1=$(( $Y + 130 )) +echo "insert into placements select switch, box '(($X,$Y),($X1,$Y1))' from switches where sysname = '$a';" +done diff --git a/tools/make-switches.pl b/tools/make-switches.pl index beb4343..c0c842a 100755 --- a/tools/make-switches.pl +++ b/tools/make-switches.pl @@ -1,4 +1,5 @@ #! /usr/bin/perl + use strict; use warnings; diff --git a/tools/make_dummy_placement.sh b/tools/make_dummy_placement.sh deleted file mode 100755 index 8a2a831..0000000 --- a/tools/make_dummy_placement.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -for a in $* ; do -X=$(( $RANDOM % 500 )) -Y=$(( $RANDOM % 500 )) -X1=$(( $X + 20 )) -Y1=$(( $Y + 130 )) -echo "insert into placements select switch, box '(($X,$Y),($X1,$Y1))' from switches where sysname = '$a';" -done -- cgit v1.2.3