Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

had to specify python2 in ups_beeper.control.sh #6

Open
carmatana opened this issue Mar 20, 2023 · 1 comment
Open

had to specify python2 in ups_beeper.control.sh #6

carmatana opened this issue Mar 20, 2023 · 1 comment

Comments

@carmatana
Copy link

carmatana commented Mar 20, 2023

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

@mrcheap1984
Copy link

Thanks for the workaround @carmatana, can confirm I needed to do this as well.

Thanks for the script.

Had the UPS go off in the middle of night as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants