Page 1 of 2

QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 4:44 pm
by ondras
Hi, I have the QNAP TS-228 NAS and I would like to use it as an WOL magic packet sender. I found the QWOL app, but I need to start the wake function from the internet (not my LAN) and I do only have the NAS GUI port (443) openned (can't open any other ports because of my provider).
I can send the magic packet using sh script (viewtopic.php?t=76012), but I need to start it using an button in GUI, not the app's webserver.
I know that every qpkg has it's start/stop script. My question is: Can I modify this script to send the wake packet when starting an qpkg from the App center? Or is there any other way to start sh script from the GUI without openning any other ports?

Thanks for replies

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 8:27 pm
by storageman
You know Qfinder has WOL option I presume.

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 8:46 pm
by ondras
storageman wrote:You know Qfinder has WOL option I presume.
I want the NAS to send WOL packet and wake a PC.

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 8:51 pm
by storageman
ondras wrote:
storageman wrote:You know Qfinder has WOL option I presume.
I want the NAS to send WOL packet and wake a PC.
dId you see this?
viewtopic.php?t=64857

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 9:25 pm
by ondras
storageman wrote:
ondras wrote:
storageman wrote:You know Qfinder has WOL option I presume.
I want the NAS to send WOL packet and wake a PC.
dId you see this?
viewtopic.php?t=64857
I don't have acces to my router from the internet. I need to solve this only with the NAS itself and only over the 443 port NAS GUI.

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 9:30 pm
by storageman
What about the wakelan stuff mentioned???

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 10:11 pm
by ondras
storageman wrote:What about the wakelan stuff mentioned???
The command needs to be executed somehow. I do not have ssh port open, so I need to execute it from GUI. The only way to do this i found is modifying the start/stop script.

Re: QNAP WOL packet send GUI control

Posted: Fri Sep 14, 2018 10:21 pm
by Mousetick
ondras wrote:Can I modify this script to send the wake packet when starting an qpkg from the App center?
Yes, but it would be better for you to create your own QPKG with your own start/stop script rather than hacking another QPKG's script.

Re: QNAP WOL packet send GUI control

Posted: Sat Sep 15, 2018 12:54 am
by ondras
Mousetick wrote:
ondras wrote:Can I modify this script to send the wake packet when starting an qpkg from the App center?
Yes, but it would be better for you to create your own QPKG with your own start/stop script rather than hacking another QPKG's script.
Yes, that's a better solution. I'll search the forum for information about creating QPKGs. Thanks for replies.

Re: QNAP WOL packet send GUI control

Posted: Sat Sep 15, 2018 1:11 am
by Mousetick
You may want to take a look at this: QNAP Development Kit.

You can install the QDK on the NAS itself from the App Center (https://www.qnap.com/en/app_center/?kw=qdk). But the link above is useful because of the documentation.

This allows you to create a skeleton QPKG. You edit the package configuration (qpkg.cfg) according to your needs. Then you add your start/stop script to the package. Then you "build" the QPKG. Finally you install it with App Center.

Re: QNAP WOL packet send GUI control

Posted: Wed Sep 19, 2018 2:37 am
by ondras
I have created the QPKG, installed it and it's not working. I used entware to install etherwake. When I run etherwake MAC from the ssh console, it wakes the pc correctly. But when I include it in the start script, it does not work. I haven't modified anything except this script. Where can I find a log from the script's execution? Why does it not work?
Thanks for anwsers.

Re: QNAP WOL packet send GUI control

Posted: Wed Sep 19, 2018 2:45 am
by OneCD
ondras wrote:When I run etherwake MAC from the ssh console, it wakes the pc correctly. But when I include it in the start script, it does not work. I haven't modified anything except this script. Where can I find a log from the script's execution? Why does it not work?
Can you post your init script?

Re: QNAP WOL packet send GUI control

Posted: Wed Sep 19, 2018 3:15 am
by Mousetick
Yeah, show your script. You probably need to specify the full /path/to/etherwake command, because it's not in the $PATH of the QPKG's environment.

Re: QNAP WOL packet send GUI control

Posted: Wed Sep 19, 2018 7:19 am
by Don
Why are you exposing the GUI interface to the internet. You are asking for trouble.

Re: QNAP WOL packet send GUI control

Posted: Wed Sep 19, 2018 4:15 pm
by ondras
The only command I added to the start script is
etherwake my_comuter's_MAC
(Yes, I added it before the ;; line)
I also think I need the full path, but I couldn't find where is it located.