2012-02-27, 02:22
Thanks. This rocks. Just some changes.
1) For some reason it couldn't find it in temp, I moved it to the 'home' folder. (.xbmc)
2) Some changes to python syntax.
1) For some reason it couldn't find it in temp, I moved it to the 'home' folder. (.xbmc)
2) Some changes to python syntax.
Code:
import subprocess, sys
if ( __name__ == "__main__" ):
if len(sys.argv)==2:
subprocess.call(['curl', '-k', '-silent', 'https://10.0.0.162/index.html', '-d', 'DATA1=Administrator&DATA2','-o','/dev/null'])
if sys.argv[ 1 ] == "on":
subprocess.call(['curl', '-k', '-silent', 'https://10.0.0.162/admin/main.html', '-d', 'DATA1=Administrator&DATA2&D1=1&V1=1', '-o', '/dev/null'])
elif sys.argv[ 1 ] == "off":
subprocess.call(['curl', '-k', '-silent', 'https://10.0.0.162/admin/main.html', '-d', 'DATA1=Administrator&DATA2&D2=0&V2=1', '-o', '/dev/null'])
elif sys.argv[ 1 ] == "xbmc":
subprocess.call(['curl', '-k', '-silent', 'https://10.0.0.162/admin/main.html', '-d', 'DATA1=Administrator&DATA2&D3=3&V3=1', '-o', '/dev/null'])
elif sys.argv[ 1 ] == "wii":
subprocess.call(['curl', '-k', '-silent', 'https://10.0.0.162/admin/main.html', '-d', 'DATA1=Administrator&DATA2&D3=5&V3=1', '-o', '/dev/null'])
else:
print "Argument not recognized"
else:
print "Argument not supplied"