diff options
author | Zader Zheng <[email protected]> | 2015-04-17 23:14:25 +0800 |
---|---|---|
committer | Zader Zheng <[email protected]> | 2015-04-17 23:14:25 +0800 |
commit | ec7869e614cd4a83175313583e080b8093a6c31b (patch) | |
tree | ada259f5adcd8405e83b58d3dc0a683cae80ea5c | |
parent | 089bb1ff9522bab4a8b1bede764e0605cb7a4203 (diff) |
add settings support on client
-rw-r--r-- | client_settings.example.sh | 3 | ||||
-rwxr-xr-x | monitor_daemon.sh | 7 |
2 files changed, 9 insertions, 1 deletions
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 |