Thanks for sharing this script, last night my UPS was beeping all the time
I had to use in the bash file "python2"
`python2 /root/upscmd.py beeper.${goal}`
if not, I first get a syntax error:
File "/root/upscmd.py", line 38 print tn.read_all().rstrip("\n")
I thought a parenthesis were needed in the print statement, but after writing them I got other error:
`Traceback (most recent call last):
File "/root/upscmd.py", line 17, in
tn.write("USERNAME {0}\n".format(user))
File "/usr/lib/python3.8/telnetlib.py", line 288, in write
if IAC in buffer:
TypeError: 'in ' requires string as left operand, not bytes`
by using python2 everything ran smoothly
Thanks for sharing this script, last night my UPS was beeping all the time
I had to use in the bash file "python2"
if not, I first get a syntax error:
File "/root/upscmd.py", line 38 print tn.read_all().rstrip("\n")I thought a parenthesis were needed in the print statement, but after writing them I got other error:
File "/root/upscmd.py", line 17, in
tn.write("USERNAME {0}\n".format(user))
File "/usr/lib/python3.8/telnetlib.py", line 288, in write
if IAC in buffer:
TypeError: 'in ' requires string as left operand, not bytes`
by using python2 everything ran smoothly