diff options
author | makefu <github@syntax-fehler.de> | 2013-03-07 11:40:38 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2013-03-07 11:40:38 +0100 |
commit | 7fa8fb85b072f612adb322f8a02617e1bd737020 (patch) | |
tree | 683df8268baae71451633518aa7ff7ea258a4aa8 /ext/solus/bin/client | |
parent | dbe2d838ba6834788265029162b2dd7d82473335 (diff) | |
parent | ef4eb3189363f5cd9a33b43693322a68d3142979 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'ext/solus/bin/client')
-rwxr-xr-x | ext/solus/bin/client | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/solus/bin/client b/ext/solus/bin/client new file mode 100755 index 00000000..60b720d6 --- /dev/null +++ b/ext/solus/bin/client @@ -0,0 +1,28 @@ +#! /bin/sh +# usage: client ACTION +# ACTION: boot, info, reboot, shutdown, or status +# environment: +# api_url URL to the client API like https://<MASTER IP>:5656/api/client +# api_key +# api_hash +set -euf + +url="$api_url/command.php" +key="$api_key" +hash="$api_hash" + +action="${1-$ACTION}" + +case "$action" in + (info) + # get all the information + action="$action&ipaddr=true&hdd=true&mem=true&bw=true";; +esac + +abspath="`readlink -f "$0"`" +bindir="`dirname "$abspath"`" +libdir="`dirname "$bindir"`/lib" +export PATH="$libdir:$PATH" + +curl -sS -d key="$key" -d hash="$hash" -d action="$action" "$url" | + parse-return-data |