+ # Make sure that the nut group actually exists
+ adduser nut nut
First, the comment and command do not match. This will *not* create a nut group. Second, this is missing a test whether both the user and the group have a system ID (100 <= id < 500). Third, this call looks really weird in the first place. How is this system user created? The standard way to do this is "adduser --system nut --group --no-create-home", which will take care of properly creating the system group as well.
+ # Make sure that the nut group actually exists
+ adduser nut nut
First, the comment and command do not match. This will *not* create a nut group. Second, this is missing a test whether both the user and the group have a system ID (100 <= id < 500). Third, this call looks really weird in the first place. How is this system user created? The standard way to do this is "adduser --system nut --group --no-create-home", which will take care of properly creating the system group as well.