Commit a60b9f07 authored by Przemysław Pawełczyk's avatar Przemysław Pawełczyk Committed by Natanael Copa
Browse files

Improve consistency of scripts using adduser/addgroup.

Following rules have been applied:
- script starts with shebang !#/bin/sh followed by blank line,
- script ends with exit 0 prepended by blank line,
- only stderr of adduser, addgroup or passwd is redirected to /dev/null,
- getent passwd/group instances has been removed,
- manual checking of file and group existence has been removed,
- `|| true` instances has been removed.

Comments and line wrapping have been preserved.
parent a593d306
#!/bin/sh
adduser -S -h /var/lib/caddy -D -s /sbin/nologin -g caddy caddy 2>/dev/null
adduser caddy www-data 2>/dev/null
exit 0
#!/bin/sh
if ! getent group davfs2 >/dev/null; then
addgroup -S davfs2
fi
addgroup -S davfs2 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S docker-registry 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -G docker-registry -g docker-registry docker-registry 2>/dev/null
exit 0
#!/bin/sh
if ! getent group docker >/dev/null; then
addgroup -S docker
fi
addgroup -S docker 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/domoticz -D -s /sbin/nologin -g domoticz domoticz 2>/dev/null
exit 0
#!/bin/sh
addgroup -S icinga 2>/dev/null
addgroup -S icingacmd 2>/dev/null
adduser -S -G icinga -H -h /var/spool/icinga2 -s /sbin/nologin -D -g icinga icinga 2>/dev/null
adduser icinga icingacmd 2>/dev/null 2>/dev/null
adduser icinga icingacmd 2>/dev/null
exit 0
#!/bin/sh
adduser -S -s /sbin/nologin -D -h /var/lib/minetest -g minetest minetest games 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -D -s /sbin/nologin -g oscam oscam 2>/dev/null
addgroup oscam usb 2>/dev/null
exit 0
......@@ -4,4 +4,5 @@ SEAFILE_HOME=/var/lib/seafile
addgroup -S -g 800 seafile 2>/dev/null
adduser -S -h $SEAFILE_HOME -s /bin/sh -G seafile -g seafile -u 800 -D seafile 2>/dev/null
exit 0
#!/bin/sh
addgroup -S smsd &>/dev/null
adduser -S -h /var/spool/sms -s /sbin/nologin -G smsd -D -g smsd smsd &>/dev/null
adduser -G uucp smsd &>/dev/null
addgroup -S smsd 2>/dev/null
adduser -S -h /var/spool/sms -s /sbin/nologin -G smsd -D -g smsd smsd 2>/dev/null
adduser -G uucp smsd 2>/dev/null
exit 0
#!/bin/sh
addgroup -S sniproxy 2>/dev/null
adduser -S -h /var/log/sniproxy -s /bin/false -D -g sniproxy sniproxy 2>/dev/null
exit 0
#!/bin/sh
echo "Adding 'sword' group for installing SWORD modules systemwide"
addgroup -S sword 2>/dev/null >&2 || true
addgroup -S sword 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -h /var/lib/syncthing -s /sbin/nologin -D -g syncthing syncthing 2>/dev/null
exit 0
#!/bin/sh
adduser -S -G video -s /sbin/nologin -H -h /usr/share/tvheadend -g tvheadend tvheadend 2>/dev/null
addgroup tvheadend usb 2>/dev/null
exit 0
#!/bin/sh
if ! getent group abuild >/dev/null; then
addgroup -S abuild
fi
addgroup -S abuild 2>/dev/null
exit 0
#!/bin/sh
if [ -e /etc/group ] && ! grep -q '^shadow:' /etc/group; then
addgroup -S -g 42 shadow
fi
addgroup -S -g 42 shadow 2>/dev/null
exit 0
......@@ -14,6 +14,6 @@ for i in /etc/modprobe.d/*; do
mv "$i" "$i".conf
done
if [ -e /etc/group ] && ! grep -q '^shadow:' /etc/group; then
addgroup -S -g 42 shadow
fi
addgroup -S -g 42 shadow 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S amavis 2>/dev/null
adduser -S -D -G amavis -h /var/amavis -s /sbin/nologin -g amavis amavis 2>/dev/null
exit 0
exit 0
#!/bin/sh
addgroup -S -g 82 www-data 2>/dev/null
adduser -S -H -h /var/www -s /sbin/nologin -D -g apache apache 2>/dev/null
addgroup apache www-data 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S -g 82 www-data 2>/dev/null
addgroup apache www-data 2>/dev/null
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment