From e525cc6c8b256fd8eba8519aa846853a3b508bcf Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Wed, 8 Oct 2014 18:17:00 +0200 Subject: [PATCH] adding script --- light.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 light.sh diff --git a/light.sh b/light.sh new file mode 100755 index 0000000..a699d3c --- /dev/null +++ b/light.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# This script is for private use only. +# Look in readme for documentation +#user= +#password= + +# DO NOT EDIT BELOW! +if [ $2 == "on" ] +then + sshpass -p "$password" ssh $user@$1 "echo 1 > /proc/power/output1" >/dev/null 2>&1 + echo on + +elif [ $2 == "off" ] +then + sshpass -p "$password" ssh $user@$1 "echo 0 > /proc/power/output1" >/dev/null 2>&1 + echo off + +else +echo "Please use following syntax: light [on off]" + +fi