Merge pull request #10980 from bobafetthotmail/master

minidlna: create UUID in config if it is empty
This commit is contained in:
Rosen Penev 2020-01-12 15:07:50 -08:00 committed by GitHub
commit a1e6aeaad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,6 @@ config minidlna config
option serial '12345678'
option model_number '1'
option root_container '.'
option uuid '019f9a56-ff60-44c0-9edc-eae88d09fa05'
option uuid ''
list media_dir '/mnt'
option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'

View File

@ -81,14 +81,18 @@ start() {
local db_dir
local log_dir
local user
local var
config_load 'minidlna'
config_get_bool enabled config 'enabled' '0'
[ "$enabled" -gt 0 ] || return 1
config_get val "config" uuid
[ "$val" = '' ] && uci set minidlna.config.uuid=$(cat /proc/sys/kernel/random/uuid) && uci commit
minidlna_create_config config || return 1
config_get db_dir config 'db_dir' '/var/run/minidlna'
config_get log_dir config 'log_dir' '/var/log/minidlna'
config_get user config 'user' 'root'