diff --git a/scripts/install b/scripts/install index edc8c69..1590d68 100644 --- a/scripts/install +++ b/scripts/install @@ -150,7 +150,7 @@ ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user ynh_system_user_create --username=$app -if [ $(grep -q "^render:" /etc/group) ]; then +if grep -q "^render:" /etc/group; then # Add user to render group adduser $app render fi @@ -218,11 +218,7 @@ needed_ports=() (( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" ) # Integrate service and require to expose the ports if needed -if [[ -z ${needed_ports[@]} ]]; then - yunohost service add $app --description="Jellyfin media center" -else - yunohost service add $app --description="Jellyfin media center" --needs_exposed_ports ${needed_ports[@]} -fi +yunohost service add $app --description="Jellyfin media center" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 22da6d5..620b9ed 100644 --- a/scripts/restore +++ b/scripts/restore @@ -162,11 +162,7 @@ needed_ports=() (( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" ) # Integrate service and require to expose the ports if needed -if [[ -z ${needed_ports[@]} ]]; then - yunohost service add $app --description="Jellyfin media center" -else - yunohost service add $app --description="Jellyfin media center" --needs_exposed_ports ${needed_ports[@]} -fi +yunohost service add $app --description="Jellyfin media center" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 778f82e..efff534 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -241,11 +241,7 @@ needed_ports=() (( $discovery_client == 1 )) && needed_ports+=( "$discovery_client_port" ) # Integrate service and require to expose the ports if needed -if [[ -z ${needed_ports[@]} ]]; then - yunohost service add $app --description="Jellyfin media center" -else - yunohost service add $app --description="Jellyfin media center" --needs_exposed_ports ${needed_ports[@]} -fi +yunohost service add $app --description="Jellyfin media center" ${needed_ports:+--needs_exposed_ports} "${needed_ports[@]}" #================================================= # START SYSTEMD SERVICE