|
|
@ -8,6 +8,8 @@ PROG=/usr/bin/gerbera |
|
|
|
start_service() { |
|
|
|
local enabled |
|
|
|
local debug |
|
|
|
local user |
|
|
|
local group |
|
|
|
local home |
|
|
|
|
|
|
|
config_load 'gerbera' |
|
|
@ -19,21 +21,26 @@ start_service() { |
|
|
|
return 1 |
|
|
|
} |
|
|
|
|
|
|
|
config_get user config 'user' 'gerbera' |
|
|
|
config_get group config 'group' 'gerbera' |
|
|
|
config_get home config 'home' '/tmp/gerbera' |
|
|
|
|
|
|
|
[ -d "$home" ] || { |
|
|
|
mkdir -p "$home" |
|
|
|
chown gerbera:gerbera "$home" |
|
|
|
chown "$user":"$group" "$home" |
|
|
|
|
|
|
|
gerbera -m "$home" -f '' --create-config > "$home/config.xml" 2> /dev/null |
|
|
|
chown "$user":"$group" "$home/config.xml" |
|
|
|
chmod 600 "$home/config.xml" |
|
|
|
|
|
|
|
echo "Created default gerbera config at $home/config.xml" |
|
|
|
echo "Please edit to your liking and restart." |
|
|
|
return 2 |
|
|
|
} |
|
|
|
|
|
|
|
procd_open_instance |
|
|
|
procd_set_param user gerbera |
|
|
|
procd_set_param group gerbera |
|
|
|
procd_set_param user "$user" |
|
|
|
procd_set_param group "$group" |
|
|
|
procd_set_param command "$PROG" -c "$home/config.xml" |
|
|
|
procd_set_param stdout "$debug" |
|
|
|
procd_set_param stderr 1 |
|
|
|