From ba80fc6691bbd19c3d61c5ecc994cf5acce37e03 Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sun, 2 Oct 2016 18:40:00 +0200 Subject: [PATCH] experiments --- README | 2 ++ light_switch.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 light_switch.py diff --git a/README b/README index e69de29..3f66d7d 100644 --- a/README +++ b/README @@ -0,0 +1,2 @@ +*mPower Utils* +actually moving from sh to python \ No newline at end of file diff --git a/light_switch.py b/light_switch.py new file mode 100755 index 0000000..3aadd7e --- /dev/null +++ b/light_switch.py @@ -0,0 +1,12 @@ +#!/bin/python +host = "127.0.0.1" +user = "admin" +passwort = "" + + +#trying it with ssh +import subprocess +proc = subprocess.Popen(['ssh', 'user@host', 'echo 1 > /proc/power/output1'], + stdin=subprocess.PIPE) + +if proc.retcode != 0: