Code: Select all
#!/bin/bash
/sbin/poweroff
What am I doing wrong?
Code: Select all
#!/bin/bash
/sbin/poweroff
Code: Select all
try:
import dbus
HAVE_DBUS = True
except ImportError:
HAVE_DBUS = False
Code: Select all
def linux_shutdown():
""" Make Linux system shutdown, never returns """
if not HAVE_DBUS:
os._exit(0)
Maybe SABnzbd is running as a user with other, less rights? Maybe n o rights to run the script and/or to run /sbin/poweroff ?kallek wrote: ↑March 18th, 2019, 1:51 am I'm having trouble executing my script on a Qnap NAS. I have a simple script that turns off the NAS that looks like this:
It is made executable with +x and I select that it should run at the end of the queue, but nothing happens. I can run the script if I ssh and type "bash shutdown.sh".Code: Select all
#!/bin/bash /sbin/poweroff
What am I doing wrong?
Code: Select all
#!/usr/bin/env bash
poweroff
Code: Select all
chmod +x testoff.sh
In QTS, almost all apps run with $EUID = 0. It's not ideal.
It looks as if Sabnzbd is running as user admin. I have disabled the admin user in QTS, but I guess Sabnzbd is able to use it anyway. Is there a way of running Sabnzbd as a less privileged user? It's a little scary if someone manage to hack the web login and get admin access.
That's not a good idea. Your NAS is no better secured and it creates other issues, particularly when you’re trying to fix things.
For now, I'm only able to support running SABnzbd as 'admin' on QTS.
Don't expose any services running on your QNAP to the Internet. Either use a reverse-proxy or VPN into your LAN.
Yes, I used the Sherpa script.
Ok, So I setup a VPN on my router. Only thing I haven't got to work is Wake On LAN, so I still have to expose a UDP port. I don't know if that is such a security concern though.
Code: Select all
-rwxrwxrwx 1 kalle everyone 31 2019-03-19 07:49 shutdown.sh*
Excellent.
As @sander mentioned above, you don't need to type:
Code: Select all
bash shutdown.sh
Code: Select all
./shutdown.sh
Code: Select all
cat -A /share/Download/nzbToMedia/shutdown.sh
I'll let the SAB experts answer that one. But 500MB seems a little large.
I had made a new folder in [share/Download/Scripts] and pointed sabnzbd to use that folder. When I moved my script to [/share/Download/nzbToMedia/] it works! I can now execute the script from sabnzbd upon queue completion.