Skip to content

Commit

Permalink
Support for disabling OpenHome Radio Service #429 (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored Jul 21, 2024
1 parent bb55522 commit 45251b5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ ENV LOG_LEVEL=""
ENV UPNP_LOG_ENABLE=""
ENV UPNP_LOG_LEVEL=""

ENV ENABLE_OPENHOME_RADIO_SERVICE=""
ENV DUMP_ADDITIONAL_RADIO_LIST=""

ENV WEBSERVER_DOCUMENT_ROOT=""
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ UPRCL_AUTOSTART|Autostart UPRCL, defaults to `1`
UPRCL_USER|Username for `uprcl`
UPRCL_HOSTPORT|Hostname and port for uprcl. Currently required when enabling UPRCL. Format: `<ip:port>`. Example value: `192.168.1.8:9090`.
UPRCL_TITLE|Title for the media server, defaults to `Local Music`
ENABLE_OPENHOME_RADIO_SERVICE|OpenHome Radio Service, enabled by default, set to `no` to disable
ENABLE_UPRCL|Enable local music support (uprcl). Set to `yes` to enable (Deprecated, use UPRCL_ENABLE)
RADIOS_ENABLE|Enable Radios plugin. Set to `yes` to enable
RADIOS_AUTOSTART|Start Radios on startup, defaults to `1`
Expand Down
52 changes: 31 additions & 21 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# 2 Invalid RENDERER_MODE value
# 3 Invalid argument

USER_CONF_PATH=/user/config

current_user_id=$(id -u)
echo "Current user id is [$current_user_id]"

Expand Down Expand Up @@ -169,9 +171,35 @@ fi

cp $SOURCE_CONFIG_FILE $CONFIG_FILE

# set fixed value
echo "radiolist = /tmp/radiolist.conf" >> $CONFIG_FILE
echo "upradiostitle = Upmpdcli Radio List" >> $CONFIG_FILE
RADIO_LIST=/tmp/radiolist.conf

MAIN_RADIO_LIST_FILENAME=/usr/share/upmpdcli/radio_scripts/radiolist.conf
ADDITIONAL_RADIO_LIST=additional-radio-list.txt

ADDITIONAL_RADIO_LIST_FILENAME="$USER_CONF_PATH/$ADDITIONAL_RADIO_LIST"
cp $MAIN_RADIO_LIST_FILENAME $RADIO_LIST
if [ -f "$ADDITIONAL_RADIO_LIST_FILENAME" ]; then
echo "Adding additional radio list file"
if [ "${DUMP_ADDITIONAL_RADIO_LIST^^}" == "YES" ]; then
cat $ADDITIONAL_RADIO_LIST_FILENAME
fi
cat $ADDITIONAL_RADIO_LIST_FILENAME >> $RADIO_LIST
else
echo "No additional radio list file."
fi

enable_openhome_radio_service=0
if [[ -z "${ENABLE_OPENHOME_RADIO_SERVICE}" ]] || [[ "${ENABLE_OPENHOME_RADIO_SERVICE^^}" == "YES" || "${ENABLE_OPENHOME_RADIO_SERVICE^^}" == "Y" ]]; then
enable_openhome_radio_service=1
elif [[ "${ENABLE_OPENHOME_RADIO_SERVICE^^}" != "NO" && "${ENABLE_OPENHOME_RADIO_SERVICE^^}" != "N" ]]; then
echo "Invalid ENABLE_OPENHOME_RADIO_SERVICE=[${ENABLE_OPENHOME_RADIO_SERVICE}]"
exit 1
fi

if [ $enable_openhome_radio_service -eq 1 ]; then
echo "radiolist = ${RADIO_LIST}" >> $CONFIG_FILE
echo "upradiostitle = Upmpdcli Radio List" >> $CONFIG_FILE
fi

set_upnp_iface=0
if [[ "$ENABLE_AUTO_UPNPIFACE" == "1" || "${ENABLE_AUTO_UPNPIFACE^^}" == "YES" || "${ENABLE_AUTO_UPNPIFACE^^}" == "Y" ]]; then
Expand Down Expand Up @@ -680,24 +708,6 @@ if [ "${UPRCL_ENABLE^^}" == "YES" ]; then
fi
fi

MAIN_RADIO_LIST_FILENAME=/usr/share/upmpdcli/radio_scripts/radiolist.conf
USER_CONF_PATH=/user/config
ADDITIONAL_RADIO_LIST=additional-radio-list.txt

RADIO_LIST=/tmp/radiolist.conf

ADDITIONAL_RADIO_LIST_FILENAME="$USER_CONF_PATH/$ADDITIONAL_RADIO_LIST"
cp $MAIN_RADIO_LIST_FILENAME $RADIO_LIST
if [ -f "$ADDITIONAL_RADIO_LIST_FILENAME" ]; then
echo "Adding additional radio list file"
if [ "${DUMP_ADDITIONAL_RADIO_LIST^^}" == "YES" ]; then
cat $ADDITIONAL_RADIO_LIST_FILENAME
fi
cat $ADDITIONAL_RADIO_LIST_FILENAME >> $RADIO_LIST
else
echo "No additional radio list file."
fi

cache_directory=/cache
if [ ! -w "$cache_directory" ]; then
echo "Cache directory [${cache_directory}] is not writable"
Expand Down
1 change: 1 addition & 0 deletions doc/change-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Change Date|Major Changes
---|---
2024-07-21|Add support for disabling OpenHome Radio Service (see issue [#429](https://github.com/GioF71/upmpdcli-docker/issues/429))
2024-07-19|Add `SKIP_CHOWN_CACHE` to skip chown on possibly crowded /cache
2024-07-12|Add script for generating tidal oauth2 credentials (see issue [#425](https://github.com/GioF71/upmpdcli-docker/issues/425))
2024-06-13|Automatically set ohproductroom to friendlyname if not explicitly set
Expand Down

0 comments on commit 45251b5

Please sign in to comment.