Compare commits
1 commit
moving_to_
...
master
Author | SHA1 | Date | |
---|---|---|---|
a8abe17fba |
4 changed files with 3 additions and 36 deletions
0
README
Normal file
0
README
Normal file
|
@ -1,2 +1,4 @@
|
||||||
# mPower Utils #
|
# mPower Utils #
|
||||||
actually moving from sh to python
|
this are some private scripts for managing mfi devices
|
||||||
|
## Maintainer ##
|
||||||
|
* Siegfried Krug <siegfried@fg4f.de>
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/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:
|
|
23
toggle.sh
23
toggle.sh
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
|
|
||||||
export MANPATH=/opt/local/share/man:$MANPATH
|
|
||||||
#
|
|
||||||
# test if mpower IP , port and output is passed to script
|
|
||||||
#
|
|
||||||
if [ $# -ne 3 ] # Test number of arguments to script.
|
|
||||||
then
|
|
||||||
echo "MpowerOnOff.sh - Parameters IP, port(1-8) or output(0|1) not specified as a parameter"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
MpowerURL="$1"
|
|
||||||
MpowerPort="$2"
|
|
||||||
MpowerOutput="$3"
|
|
||||||
MpowerCmd="output="$MpowerOutput" -b ""AIROS_SESSIONID=01234567890123456789012345678901"" "$MpowerURL"/sensors/"$MpowerPort
|
|
||||||
#echo $MpowerURL
|
|
||||||
#echo $MpowerPort
|
|
||||||
#echo $MpowerOutput
|
|
||||||
#echo $MpowerCmd
|
|
||||||
#login
|
|
||||||
curl --silent -X POST -d "username=admin&password=marshall" -b "AIROS_SESSIONID=01234567890123456789012345678901" $MpowerURL"/login.cgi"
|
|
||||||
#toggle port
|
|
||||||
echo $(curl --silent -X PUT -d $MpowerCmd )
|
|
Loading…
Reference in a new issue