QNAP WOL packet send GUI control

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
User avatar
OneCD
Guru
Posts: 12143
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP WOL packet send GUI control

Post by OneCD »

Please post the entire script. ;)

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
ondras
Starting out
Posts: 12
Joined: Wed Sep 12, 2018 4:35 pm

Re: QNAP WOL packet send GUI control

Post by ondras »

Don wrote:Why are you exposing the GUI interface to the internet. You are asking for trouble.
I need to have access to my NAS from the internet. I'm using the Qfile app on my Android devices to access my data. I also sometimes need to change the configuration from the internet. I only have the 443 port open and I have stopped the photo station app (I know there was a problem with it)
The passwords are strong enough and there's a limit for unsuccessful logins.
ondras
Starting out
Posts: 12
Joined: Wed Sep 12, 2018 4:35 pm

Re: QNAP WOL packet send GUI control

Post by ondras »

Ok, here's the script:

Code: Select all

#!/bin/sh
CONF=/etc/config/qpkg.conf
QPKG_NAME="Wake"
QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}`
APACHE_ROOT=`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info`
export QNAP_QPKG=$QPKG_NAME

case "$1" in
  start)
    ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
    if [ "$ENABLED" != "TRUE" ]; then
        echo "$QPKG_NAME is disabled."
        exit 1
    fi
    
    etherwake 00:00:00:00:00:00 (MAC censored)
    ;;

  stop)
    : ADD STOP ACTIONS HERE
    ;;

  restart)
    $0 stop
    $0 start
    ;;

  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac

exit 0
User avatar
OneCD
Guru
Posts: 12143
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP WOL packet send GUI control

Post by OneCD »

How are you running it when testing? Please show, along with the resulting exitcode.

For your purposes, this init can be a lot simpler:

Code: Select all

#!/usr/bin/env bash

case "$1" in
  start)
    etherwake 00:00:00:00:00:00 (MAC censored)
    ;;
  stop)
    : ADD STOP ACTIONS HERE
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
ondras
Starting out
Posts: 12
Joined: Wed Sep 12, 2018 4:35 pm

Re: QNAP WOL packet send GUI control

Post by ondras »

I've installed the QPKG to the NAS, ran in and it did not wake the PC. I don't know where to find some log from the script's execution, so I have no idea what's going on. I did not have enough time to debug it yesterday.
User avatar
OneCD
Guru
Posts: 12143
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP WOL packet send GUI control

Post by OneCD »

Before you install the package and expect it to work flawlessly, you first need to test that the init script runs. Please demonstrate how you're doing this.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
ondras
Starting out
Posts: 12
Joined: Wed Sep 12, 2018 4:35 pm

Re: QNAP WOL packet send GUI control

Post by ondras »

OneCD wrote:Before you install the package and expect it to work flawlessly, you first need to test that the init script runs. Please demonstrate how you're doing this.
Sorry I'm total beginner. I red the http://download.qnap.com/dev/QDK_Quick_ ... v4_eng.pdf and built the qpkg file. I haven't tested it before building.
User avatar
OneCD
Guru
Posts: 12143
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP WOL packet send GUI control

Post by OneCD »

What is the filename of your init script and what is the path to it? Not the installed package path, but the path to your package source files. If you provide these, it will be easier to show how to run the script.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
avishai0528
First post
Posts: 1
Joined: Sun Jul 11, 2021 12:54 am

Re: QNAP WOL packet send GUI control

Post by avishai0528 »

Did you try running a Debian/Ubuntu Docker and run it from there?

I made it work with no problem, also I integrated it with Goggle Assistant.


Contact me if you need assistance.
Last edited by OneCD on Sun Jul 11, 2021 3:46 am, edited 1 time in total.
Reason: contact details removed
User avatar
OneCD
Guru
Posts: 12143
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP WOL packet send GUI control

Post by OneCD »

* topic locked to prevent further necroposting *

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
Locked

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”