Skip to content

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

@carmatana

Description

@carmatana

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions