diff --git a/scripts/install b/scripts/install index af51f33..7129efe 100644 --- a/scripts/install +++ b/scripts/install @@ -40,7 +40,7 @@ install_jellyfin_packages #=================================================รง ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -if grep -q "^render:" /etc/group; then +if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then # Add user to render group adduser "$app" render fi diff --git a/scripts/restore b/scripts/restore index 73eff90..c0860b5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,7 +19,7 @@ ynh_script_progression --message="Reconfiguring the dedicated system user..." -- # It could be created later by the deb, but it's cleaner here ynh_system_user_create --username=$app -if grep -q "^render:" /etc/group; then +if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then # Add user to render group adduser $app render fi diff --git a/scripts/upgrade b/scripts/upgrade index 6ae5f92..30965d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" -- ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If render group exists, and system user doesn't belong to it, add it -if grep -q "^render:" /etc/group && ! id -Gn "$app" | grep -q '\brender\b'; then +if getent group render && ! id -Gn "$app" | grep -qw "\brender\b" >/dev/null; then adduser "$app" render fi