From 8241d780cb03977cec1eca1c64fd34b1858e7061 Mon Sep 17 00:00:00 2001 From: Adrian Priestley <47989725+a-priestley@users.noreply.github.com> Date: Sun, 9 Jul 2023 18:10:26 -0230 Subject: [PATCH 1/3] Add IP and port targeting for WoL --- root/usr/local/bin/wol_rffmpeg/wol | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/root/usr/local/bin/wol_rffmpeg/wol b/root/usr/local/bin/wol_rffmpeg/wol index 895fc9d..019f77f 100755 --- a/root/usr/local/bin/wol_rffmpeg/wol +++ b/root/usr/local/bin/wol_rffmpeg/wol @@ -14,8 +14,15 @@ if [ $RFFMPEG_WOL == "native" ] && [ ! -z $RFFMPEG_HOST ] && [ ! -z $RFFMPEG_HOS then echo WOL enabled echo "$RFFMPEG_HOST" is down, sending wakeup to "$mac" - wakeonlan $mac - #wakeonlan -i $RFFMPEG_HOST $mac + + WOL_OPTIONS="" + if [ ! -z $WOL_NATIVE_HOST ]; then + WOL_OPTIONS="$WOL_OPTIONS -i $WOL_NATIVE_HOST" + fi + if [ ! -z $WOL_NATIVE_PORT ]; then + WOL_OPTIONS="$WOL_OPTIONS -p $WOL_NATIVE_PORT" + fi + wakeonlan $WOL_OPTIONS $mac echo "waiting $WOL_WAIT seconds for $RFFMPEG_HOST to wake" sleep $WOL_WAIT fi From 1afcabbcd1f4f51606c9fea1d9b52dabb1d027c0 Mon Sep 17 00:00:00 2001 From: Adrian Priestley <47989725+a-priestley@users.noreply.github.com> Date: Sun, 9 Jul 2023 18:19:07 -0230 Subject: [PATCH 2/3] Add NAT forwarding instructions for WoL --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fafcded..02057bb 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,5 @@ WOL ENV: * WOL_API = IP of docker host * WOL_API_PORT= port wol_api is running on * WOL_WAIT= time in seconds to wait for host to wake +* WOL_NATIVE_HOST = IP of NAT gateway with forwarded port for WoL +* WOL_NATIVE_PORT = External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. From 5ec27b38a0d2dc870d94b2449e3664c084ae740c Mon Sep 17 00:00:00 2001 From: Adrian Priestley <47989725+a-priestley@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:55:18 -0230 Subject: [PATCH 3/3] Update README.md Specify optional use of variables relating to NAT WoL --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02057bb..69984cc 100644 --- a/README.md +++ b/README.md @@ -86,5 +86,7 @@ WOL ENV: * WOL_API = IP of docker host * WOL_API_PORT= port wol_api is running on * WOL_WAIT= time in seconds to wait for host to wake -* WOL_NATIVE_HOST = IP of NAT gateway with forwarded port for WoL -* WOL_NATIVE_PORT = External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. +* WOL_NATIVE_HOST = IP of NAT gateway with forwarded port for WoL * +* WOL_NATIVE_PORT = External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. * + +*Optional. Only applicable when not using the WoL docker service API and when waking from outside NAT is required. Omit, or leave blank otherwise.