summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-01-30 20:57:50 +0100
committerErich Eckner <git@eckner.net>2021-01-30 20:57:50 +0100
commit91655f4486c47fb9f837acc9cb0e8842abf38fde (patch)
tree271a4bf6d94d1ce4d6430db83bc281eda64e1fae
parentba7b8145c7042eb6f56e11ddc2f497f0be3ec19e (diff)
downloadraspi-lights-out-91655f4486c47fb9f837acc9cb0e8842abf38fde.tar.xz
neue Version: 0.1v0.1
-rw-r--r--Makefile2
-rw-r--r--lights-out.in9
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e71cf0c..72fee35 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ BINDIR = /usr/bin
LIBDIR = /usr/lib
HTTPDIR = /srv/http/lights-out
-VERSION = 0.0
+VERSION = 0.1
all: index.php lights-out lights-out-init.service lights-out@.service
diff --git a/lights-out.in b/lights-out.in
index 144d7bd..e45a5c9 100644
--- a/lights-out.in
+++ b/lights-out.in
@@ -118,6 +118,15 @@ case "$1" in
"$0" push power 0.1 || exit $?
fi
;;
+ 'turn on')
+ check_argument_count 2 "$@"
+ value=$(
+ "$0" get power
+ ) || exit $?
+ if [ "${value}" -eq 0 ]; then
+ "$0" push power 0.1 || exit $?
+ fi
+ ;;
*)
>&2 printf 'unknown command "%s"\n\n' "$1"
display_help