Skip to content

Commit c7dea75

Browse files
authored
Merge pull request #728 from a-priestley/jellyfin-rffmpeg
Jellyfin rffmpeg NAT WoL
2 parents 1dc36f4 + 5ec27b3 commit c7dea75

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,7 @@ WOL ENV:
8686
* WOL_API = IP of docker host
8787
* WOL_API_PORT= port wol_api is running on
8888
* WOL_WAIT= time in seconds to wait for host to wake
89+
* WOL_NATIVE_HOST = IP of NAT gateway with forwarded port for WoL *
90+
* WOL_NATIVE_PORT = External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. *
91+
92+
*Optional. Only applicable when not using the WoL docker service API and when waking from outside NAT is required. Omit, or leave blank otherwise.

root/usr/local/bin/wol_rffmpeg/wol

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ if [ $RFFMPEG_WOL == "native" ] && [ ! -z $RFFMPEG_HOST ] && [ ! -z $RFFMPEG_HOS
1414
then
1515
echo WOL enabled
1616
echo "$RFFMPEG_HOST" is down, sending wakeup to "$mac"
17-
wakeonlan $mac
18-
#wakeonlan -i $RFFMPEG_HOST $mac
17+
18+
WOL_OPTIONS=""
19+
if [ ! -z $WOL_NATIVE_HOST ]; then
20+
WOL_OPTIONS="$WOL_OPTIONS -i $WOL_NATIVE_HOST"
21+
fi
22+
if [ ! -z $WOL_NATIVE_PORT ]; then
23+
WOL_OPTIONS="$WOL_OPTIONS -p $WOL_NATIVE_PORT"
24+
fi
25+
wakeonlan $WOL_OPTIONS $mac
1926
echo "waiting $WOL_WAIT seconds for $RFFMPEG_HOST to wake"
2027
sleep $WOL_WAIT
2128
fi

0 commit comments

Comments
 (0)