Skip to content

Commit a23b546

Browse files
committed
dietpi-patches: replace "usermod -r" with gpasswd
"usermod -r" is available only from Bookworm on. To be compatible with Bullseye, we switch to gpasswd. It however fails, if the user is not actually member of the group anymore, hence adjust the test as well.
1 parent d5159b0 commit a23b546

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.update/patches

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ Patch_9_11()
21322132
[[ -d '/etc/nginx/sites-dietpi' ]] && G_EXEC rm -f /etc/nginx/sites-dietpi/dietpi-pihole*
21332133

21342134
# Remove www-data user from pihole group
2135-
getent group pihole > /dev/null && G_EXEC usermod -rG pihole www-data
2135+
getent group pihole | grep -Eq '(:|,)www-data(,|$)' && G_EXEC gpasswd -d www-data pihole
21362136

21372137
# Change web UI port to 8089 to avoid conflict with webservers and other web applications
21382138
G_EXEC pihole-FTL --config webserver.port 8089

0 commit comments

Comments
 (0)