From ec7869e614cd4a83175313583e080b8093a6c31b Mon Sep 17 00:00:00 2001 From: Zader Zheng Date: Fri, 17 Apr 2015 23:14:25 +0800 Subject: add settings support on client --- client_settings.example.sh | 3 +++ monitor_daemon.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 client_settings.example.sh diff --git a/client_settings.example.sh b/client_settings.example.sh new file mode 100644 index 0000000..59bd00f --- /dev/null +++ b/client_settings.example.sh @@ -0,0 +1,3 @@ +#!/bin/bash +export SOCKET_HOST=127.0.0.1 +export SOCKET_PORT=2334 diff --git a/monitor_daemon.sh b/monitor_daemon.sh index 7d976ee..e18720f 100755 --- a/monitor_daemon.sh +++ b/monitor_daemon.sh @@ -4,7 +4,12 @@ # echo "you must specify the triggered command" # exit 1 #fi -CLIENT="python lab_monitor_client.py" +if [[ -e client_settings.sh ]]; then + source client_settings.sh + SOCKET_SPEC="--host $SOCKET_HOST --port $SOCKET_PORT" +fi +echo "Reporting to $SOCKET_SPEC" +CLIENT="python lab_monitor_client.py $SOCKET_SPEC" function on_exit { $CLIENT --drop "$JID" exit 0 -- cgit v1.2.3-70-g09d2