Skip to content

Commit

Permalink
[Enhancement] Add DISABLE_MAC_ADDRESS_GENERATION #259
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Jan 1, 2024
1 parent 56c3747 commit 471b973
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ENV SQUEEZELITE_MODE ""
ENV SQUEEZELITE_AUDIO_DEVICE ""
ENV SQUEEZELITE_MIXER_DEVICE ""
ENV SQUEEZELITE_MAC_ADDRESS ""
ENV DISABLE_MAC_ADDRESS_GENERATION ""
ENV SQUEEZELITE_NAME ""
ENV SQUEEZELITE_MODEL_NAME ""
ENV SQUEEZELITE_TIMEOUT ""
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ SQUEEZELITE_DELAY|-D|Set it to maybe something like `500,dop` if your DAC suppor
SQUEEZELITE_NAME|-n|Name of the SqueezeLite player.
SQUEEZELITE_MODEL_NAME|-M|Name of the SqueezeLite model name.
SQUEEZELITE_MAC_ADDRESS|-m|Mac Address of the SqueezeLite player. The format must be colon-delimited hexadecimal, for example: `ab:cd:ef:12:34:56`. See note below.
DISABLE_MAC_ADDRESS_GENERATION||Disables automatic mac address generation and persistency
SQUEEZELITE_TIMEOUT|-C|Device timeout in seconds, defaults to `2`
SQUEEZELITE_SERVER_PORT|-s|Server and port of the server, for example: `squeezebox-server.local:3483` or `192.168.1.10:3483`. Do not specify the variable if you want to use the auto discovery feature. If you don't specify this variable, you will probably need to use host network mode. See the examples for some hints. The port can be omitted if not different from the default `3483`. So other possible valid values are `squeezebox-server.local` or `192.168.1.10`.
SQUEEZELITE_RATES|-r|From squeezelite's man page for `-r`: Specify sample rates supported by the output device; this is required if the output device is switched off when squeezelite is started. The format is either a single maximum sample rate, a range of sample rates in the format `<min>-<max>`, or a comma-separated list of available rates. Delay is an optional time to wait when switching sample rates between tracks, in milliseconds. Switch back to the author of this repository: it is recommended to specify sample rates that are effectively supported by your audio device.
Expand Down Expand Up @@ -130,6 +131,7 @@ Possible values for variables `SQUEEZELITE_LOG_CATEGORY_*` are `info`, `debug` o

If you don't provide a value to `SQUEEZELITE_MAC_ADDRESS`, a random mac address will be generated and stored (if possible) under `/config/mac-address.txt`, so it will be reloaded on next restart. The file name can be prepended by the optional `CONFIG_FILE_PREFIX`.
Use a persistent volume in order to preserve the functionality in the event of container recreation (such as when you update to a newer image).
This feature can be disabled by setting `DISABLE_MAC_ADDRESS_GENERATION` to `yes`.

## Volumes

Expand Down
6 changes: 5 additions & 1 deletion app/bin/cmd-line-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ function cmdline-rates() {
}

function handle_mac_address() {
if [[ -z "${SQUEEZELITE_MAC_ADDRESS}" ]]; then
mac_gen_disabled=0
if [[ "${DISABLE_MAC_ADDRESS_GENERATION^^}" == "YES" ]] || [[ "${DISABLE_MAC_ADDRESS_GENERATION^^}" == "Y" ]]; then
mac_gen_disabled=1
fi
if [[ $mac_gen_disabled -eq 0 ]] && [[ -z "${SQUEEZELITE_MAC_ADDRESS}" ]]; then
FILE_NAME=mac-address.txt
if [[ -n "${CONFIG_FILE_PREFIX}" ]]; then
FILE_NAME=${CONFIG_FILE_PREFIX}-${FILE_NAME}
Expand Down
1 change: 1 addition & 0 deletions doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Older build might be dropped in order to save space on docker-hub and incur in l

Date|Type|Description
:---|:---|:---
2024-01-01|Improvement|Allow disabling automatic mac addres generation (see [#259](https://github.com/GioF71/squeezelite-docker/issues/259))
2023-12-31|Improvement|Reduce alsa dependencies (see [#257](https://github.com/GioF71/squeezelite-docker/issues/257))
2023-12-30|Improvement|Separate builds for alsa and pulseaudio (see [#254](https://github.com/GioF71/squeezelite-docker/issues/254))
2023-12-18|Improvement|Support for a config file prefix (see [#249](https://github.com/GioF71/squeezelite-docker/issues/249))
Expand Down

0 comments on commit 471b973

Please sign in to comment.