Page 1 of 1

Set power_options to "false" i.e. *disable* shutdown/suspend on queue finish

Posted: October 6th, 2020, 7:52 am
by Dr_Spaceman
Is there a way to do this? All my googling leads me to ways to enable this or fix it when it's not working. I want to *prevent* the Sabnzbd user from being able to do this, not even see those options in the dropdown menu.

It seems like the way to do it would be to set would be to set the variable $power_options to "false". The statement "#if $power_options#" shows up in the template files whenever the dropdown menu option is given to shutdown, standby, or hibernate. There is a statement

Code: Select all

header['power_options'] = sabnzbd(dot)WIN32 or sabnzbd(dot)DARWIN or sabnzbd(dot)LINUX_POWER
in the api(dot)py file, but that's the only other reference I could find to "power_options", and it looks like this one just involves the api.

I know next-to-nothing about Python so I can't go any further than that. Any help would be much appreciated.

I am using SABnzbd version: 2.3.2 on Ubuntu 18.04

Re: Set power_options to "false" i.e. *disable* shutdown/suspend on queue finish

Posted: October 6th, 2020, 8:25 am
by safihre
The only way to do this is through the code.
In sabnzbd/__init__.py you can replace the line with LINUX_POWER to:

Code: Select all

LINUX_POWER=False

Re: Set power_options to "false" i.e. *disable* shutdown/suspend on queue finish

Posted: October 6th, 2020, 8:45 am
by Dr_Spaceman
When I set it to "false" I got an error starting the program, but when I set it to "0" that worked exactly as I wanted it to, thank you.