From 609dd2e9e89c047399ab2e554e3411df7e6e2676 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Jan 2013 13:59:28 +0100 Subject: ext solus client: initial commit to access the SolusVM Client API --- ext/solus/bin/client | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 ext/solus/bin/client (limited to 'ext/solus/bin') 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://: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 -- cgit v1.2.3