Skip to content

Commit 6dcbbae

Browse files
authored
Merge pull request #737 from JeWe37/jellyfin-rffmpeg
Make rffmpeg universally compatible
2 parents c7dea75 + d086808 commit 6dcbbae

File tree

2 files changed

+27
-5
lines changed
  • root
    • etc/s6-overlay/s6-rc.d/init-mod-jellyfin-rffmpeg-add-package
    • usr/local/bin/wol_rffmpeg

2 files changed

+27
-5
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-jellyfin-rffmpeg-add-package/run

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
#!/usr/bin/with-contenv bash
22

3-
for package in iputils-ping openssh-client python3-click python3-yaml wakeonlan; do
4-
if ! dpkg -s "${package}" >/dev/null 2>&1; then
5-
PACKAGES="${package} ${PACKAGES}"
3+
## Ubuntu
4+
if [ -f /usr/bin/apt ]; then
5+
for package in iputils-ping openssh-client python3-click python3-yaml python3 wakeonlan; do
6+
if ! dpkg -s "${package}" >/dev/null 2>&1; then
7+
PACKAGES="${package} ${PACKAGES}"
8+
fi
9+
done
10+
fi
11+
# Alpine
12+
if [ -f /sbin/apk ]; then
13+
if ! grep -qxF '@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing' /etc/apk/repositories; then
14+
echo @testing https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
615
fi
7-
done
16+
for package in openssh py3-click py3-yaml python3 wol@testing; do
17+
if ! apk info -e "${package}" >/dev/null 2>&1; then
18+
PACKAGES="${package} ${PACKAGES}"
19+
fi
20+
done
21+
fi
822

923
if [ -n "${PACKAGES}" ]; then
1024
echo "${PACKAGES}" >> /mod-repo-packages-to-install.list

root/usr/local/bin/wol_rffmpeg/wol

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ then
2222
if [ ! -z $WOL_NATIVE_PORT ]; then
2323
WOL_OPTIONS="$WOL_OPTIONS -p $WOL_NATIVE_PORT"
2424
fi
25-
wakeonlan $WOL_OPTIONS $mac
25+
# Alpine
26+
if [ -f /sbin/apk ]; then
27+
wol $WOL_OPTIONS $mac
28+
fi
29+
# Ubuntu
30+
if [ -f /usr/bin/apt ]; then
31+
wakeonlan $WOL_OPTIONS $mac
32+
fi
33+
#wakeonlan -i $RFFMPEG_HOST $mac
2634
echo "waiting $WOL_WAIT seconds for $RFFMPEG_HOST to wake"
2735
sleep $WOL_WAIT
2836
fi

0 commit comments

Comments
 (0)