Skip to content

Commit

Permalink
support multiple media directories
Browse files Browse the repository at this point in the history
  • Loading branch information
cwoac committed Jul 17, 2018
1 parent b4c412a commit cb93672
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions minidlna/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,19 @@ docker run -d --net=host \
vladgh/minidlna
```

### Multiple Media dirs

Any environment variable starting MEDIA_DIR will be treated as an additional media_dir directive.

```
docker run -d --net=host \
-p 8200:8200 \
-v <media dir on host>:/media/audio \
-v <media dir on host>:/media/video \
-e MEDIADIR_1=A:/media/audio \
-e MEDIADIR_1=V:/media/video \
-e MINIDLNA_FRIENDLY_NAME=MyMini \
vladgh/minidlna
```

See: http://manpages.ubuntu.com/manpages/raring/man5/minidlna.conf.5.html
5 changes: 5 additions & 0 deletions minidlna/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ for VAR in $(env); do
minidlna_value=$(echo "$VAR" | sed -r "s/.*=(.*)/\1/g")
echo "${minidlna_name}=${minidlna_value}" >> /etc/minidlna.conf
fi
if [[ "$VAR" =~ ^MEDIA_DIR ]]; then
minidlna_name=media_dir
minidlna_value=$(echo "$VAR" | sed -r "s/.*=(.*)/\1/g")
echo "${minidlna_name}=${minidlna_value}" >> /etc/minidlna.conf
fi
done

# Start daemon
Expand Down

0 comments on commit cb93672

Please sign in to comment.