introduce deplyoment config
[rrq/hourglass.git] / setup.sh
index 3585d74d12bbe45a9053ba1f657f25e83bcc8fa0..4cf7a80d8c6ffdb89e89bab1042029d40583208c 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
@@ -3,10 +3,14 @@
 # This is a control script to start and stop the network activity
 # listening.
 
-CMD=${1-start}
-NET=192.168.249
-TAP=hourglass0
-SET=TIMO
+CONF="hourglass.conf"
+function getcfg() {
+    grep -E "\\s*[^;#]$1]\\s*=" $CONF | sed 's/.*=\s*(.*)/\1/;s/\s*$//'
+}
+
+NET="$(getcfg listener.ip)"
+TAP="$(getcfg listener.tap)"
+SET="$(getcfg ipset.table)"
 
 cd $(dirname $0)