adding script
This commit is contained in:
parent
9ecbd706a2
commit
e525cc6c8b
1 changed files with 21 additions and 0 deletions
21
light.sh
Executable file
21
light.sh
Executable file
|
@ -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 <host> [on off]"
|
||||||
|
|
||||||
|
fi
|
Loading…
Reference in a new issue