From df069471bbd80fc9d5645ebdcb45d811c612889b Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Tue, 29 Apr 2014 16:37:38 +0200 Subject: [PATCH] the config files and scripts for this year --- boxxy/src/config.js | 2 +- tools/boxxy.sh | 13 +++++++++++++ tools/copy_to_all_gyrids.sh | 5 +++++ tools/do_on_all_gyrids.sh | 5 +++++ tools/heartbeat.sh | 11 ++++++++++- 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 tools/boxxy.sh create mode 100644 tools/copy_to_all_gyrids.sh create mode 100644 tools/do_on_all_gyrids.sh diff --git a/boxxy/src/config.js b/boxxy/src/config.js index 034e9d0..90b47b4 100644 --- a/boxxy/src/config.js +++ b/boxxy/src/config.js @@ -1,4 +1,4 @@ -exports.BOXXY_HOSTNAME = 'live.12urenloop.be'; +exports.BOXXY_HOSTNAME = 'localhost'; exports.BOXXY_PORT = 8080; exports.BOXXY_USER = 'count-von-count'; exports.BOXXY_PASSWORD = 'tetten'; diff --git a/tools/boxxy.sh b/tools/boxxy.sh new file mode 100644 index 0000000..98b981d --- /dev/null +++ b/tools/boxxy.sh @@ -0,0 +1,13 @@ + +send() { + curl -XPUT localhost:8080/state \ + -H 'Content-Type: application/json' \ + -u 'count-von-count:tetten' \ + -d "$1" +} + +case $1 in + "freeze") send '{"frozen": true}';; + "melt") send '{"frozen": false}';; + "notify") send '{"notification": "'$2'"}';; +esac diff --git a/tools/copy_to_all_gyrids.sh b/tools/copy_to_all_gyrids.sh new file mode 100644 index 0000000..d6693ae --- /dev/null +++ b/tools/copy_to_all_gyrids.sh @@ -0,0 +1,5 @@ + +for i in 1 2 3 4 5; do + scp "$1" root@gyrid$i:"'$2'" +done + diff --git a/tools/do_on_all_gyrids.sh b/tools/do_on_all_gyrids.sh new file mode 100644 index 0000000..85a729b --- /dev/null +++ b/tools/do_on_all_gyrids.sh @@ -0,0 +1,5 @@ + +for i in 1 2 3 4 5; do + ssh root@gyrid$i "$1" & +done + diff --git a/tools/heartbeat.sh b/tools/heartbeat.sh index ed4c7e7..674c8b7 100644 --- a/tools/heartbeat.sh +++ b/tools/heartbeat.sh @@ -1,6 +1,15 @@ #!/bin/bash +### BEGIN INIT INFO +# Provides: heartbeat +# Required-Start: $local_fs $remote_fs $network $syslog bluetooth network-manager gyrid +# Required-Stop: $local_fs $remote_fs $network $syslog bluetooth network-manager gyrid +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop Gyrid Bluetooth scanner +### END INIT INFO- +# -SIHEMO="count:8002" +SIHEMO="10.1.2.100:8002" GROUP=$(hostname) ALIVE="30"