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

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
#!/bin/sh
adduser -S -D -g buildozer buildozer -s /bin/sh 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g arpwatch arpwatch 2>/dev/null
exit 0
exit 0
......@@ -3,4 +3,5 @@
adduser -S -h /var/lib/asterisk -s /sbin/nologin -D -g asterisk asterisk 2>/dev/null
addgroup -S dialout 2>/dev/null
addgroup asterisk dialout 2>/dev/null
exit 0
......@@ -3,4 +3,5 @@
adduser -S -h /var/lib/asterisk -s /bin/false -D -g asterisk asterisk 2>/dev/null
addgroup -S dialout 2>/dev/null
addgroup asterisk dialout 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -h /usr/share/webapps/atheme-iris -g iris -D -s /sbin/nologin iris >/dev/null
exit 0
exit 0
#!/bin/sh
addgroup -S backuppc &>/dev/null
adduser -S -h /var/lib/BackupPC -s /bin/sh -D -H -G backuppc -g "BackupPC user" backuppc &>/dev/null
addgroup -S backuppc 2>/dev/null
adduser -S -h /var/lib/BackupPC -s /bin/sh -D -H -G backuppc -g "BackupPC user" backuppc 2>/dev/null
exit 0
#!/bin/sh
addgroup -S bacula 2>/dev/null
adduser -S -h /var/lib/bacula/ -s /sbin/nologin -G bacula -D -g bacula bacula 2>/dev/null
exit 0
#!/bin/sh
addgroup -S bacula 2>/dev/null
adduser -S -h /var/lib/bacula/ -s /sbin/nologin -G bacula -D -g bacula bacula 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S named 2>/dev/null
adduser -S -h /etc/bind -s /sbin/nologin -G named -D -g named named 2>/dev/null
exit 0
exit 0
#!/bin/sh
adduser -S -h /var/run/charybdis -s /sbin/nologin -D -g ircd ircd 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S chrony 2>/dev/null
adduser -S -G chrony -h /var/log/chrony -s /sbin/nologin -D -g chrony chrony 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S clamav 2>/dev/null
adduser -S -h /var/lib/clamav -H -s /sbin/nologin -D -G clamav -g clamav clamav 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g clamav clamav 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S clamav 2>/dev/null
adduser -S -h /var/lib/clamav -H -s /sbin/nologin -D -G clamav -g clamav clamav 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g clamav clamav 2>/dev/null
exit 0
......@@ -11,4 +11,5 @@ if [ -f "$old" ] && [ ! -f "$new" ]; then
fi
adduser -S -H -s /bin/false -D -g clamav clamav 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g chilli chilli 2>/dev/null
exit 0
exit 0
......@@ -4,4 +4,5 @@ addgroup -S lpadmin 2>/dev/null
addgroup -S lp 2>/dev/null
adduser -S -G lp -g lp lp 2>/dev/null
addgroup lp lp 2>/dev/null
exit 0
#!/bin/sh
addgroup -S cvechecker &>/dev/null
adduser -S -g cvechecker cvechecker -h /var/cvechecker -DG cvechecker &>/dev/null
addgroup -S cvechecker 2>/dev/null
adduser -S -g cvechecker cvechecker -h /var/cvechecker -DG cvechecker 2>/dev/null
exit 0
......@@ -6,5 +6,6 @@ adduser -S -D -H \
-s /sbin/nologin \
-G dansguar \
-g dansguar \
dansguar 2>/dev/null || true
dansguar 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S messagebus 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -g messagebus messagebus -G messagebus 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/dhcp -s /sbin/nologin -D -g dhcp dhcp 2>/dev/null
exit 0
exit 0
......@@ -2,4 +2,5 @@
addgroup -S distcc 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -G distcc -D -g distcc distcc 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /etc/dnscache -g dnscache -s /sbin/nologin -H -D dnscache 2>/dev/null
exit 0
exit 0
#!/bin/sh
adduser -S -h /etc/tinydns -g tinydns -s /sbin/nologin -H -D tinydns 2>/dev/null
exit 0
exit 0
......@@ -2,4 +2,5 @@
addgroup -S dnsmasq 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -G dnsmasq -D -g dnsmasq dnsmasq 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
adduser -S -u 90 -H -h /dev/null -s /sbin/nologin -D -g dovecot dovecot 2>/dev/null
adduser -S -u 91 -H -h /dev/null -s /sbin/nologin -D -g dovenull dovenull 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/ez-ipupdate -s /sbin/nologin -D -g ipupdate ipupdate 2>/dev/null
exit 0
exit 0
#!/bin/sh
adduser -S -H -h /var/lib/fetchmail -s /sbin/nologin -D -g fetchmail fetchmail 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S radius 2>/dev/null
adduser -S -G radius -h /var/log/radius -s /sbin/nologin -D -g radius radius 2>/dev/null
exit 0
exit 0
......@@ -2,4 +2,5 @@
addgroup -S gdnsd 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -G gdnsd -g gdnsd gdnsd 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -h /var/lib/git -s /bin/sh -D -g git git 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/gnatsdb -D -g gnats gnats 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g gross gross 2>/dev/null
exit 0
......@@ -10,3 +10,4 @@ if [ -e /etc/haproxy.cfg ] && ! [ -e /etc/haproxy/haproxy.cfg ]; then
mv /etc/haproxy.cfg /etc/haproxy/haproxy.cfg
fi
exit 0
......@@ -10,3 +10,4 @@ if [ -e /etc/haproxy.cfg ] && ! [ -e /etc/haproxy/haproxy.cfg ]; then
mv /etc/haproxy.cfg /etc/haproxy/haproxy.cfg
fi
exit 0
#!/bin/sh
adduser -S -h /var/log/icecast -s /sbin/nologin -D -g icecast icecast 2>/dev/null
adduser -S -h /var/log/icecast -s /sbin/nologin -D -g icecast icecast 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/ircservices -s /sbin/nologin -D -g ircservices ircservices 2>/dev/null
exit 0
exit 0
#!/bin/sh
addgroup -S kamailio 2>/dev/null
adduser -S -H -h /var/empty -s /sbin/nologin -D -G kamailio -g kamailio kamailio 2>/dev/null
adduser -S -H -h /var/empty -s /sbin/nologin -D -G kamailio -g kamailio kamailio 2>/dev/null
exit 0
#!/bin/sh
if ! getent group camera >/dev/null; then
addgroup -S camera
fi
addgroup -S camera 2>/dev/null
exit 0
#!/bin/sh
addgroup -S libvirt &>/dev/null
addgroup -S libvirt 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S logcheck 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -G logcheck -g logcheck logcheck 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S mysql 2>/dev/null
adduser -S -h /var/lib/mysql -s /sbin/nologin -G mysql -D -g mysql mysql 2>/dev/null
exit 0
exit 0
#!/bin/sh
adduser -S -H -s /sbin/nologin -D -g memcached memcached 2>/dev/null
exit 0
exit 0
......@@ -3,4 +3,5 @@
addgroup -S minidlna 2>/dev/null
adduser -S -H -h /var/run/minidlna -s /sbin/nologin -D -G minidlna \
-g minidlna minidlna 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S mlmmj 2>/dev/null
adduser -S -H -h /var/spool/mlmmj -s /sbin/nologin -D -G mlmmj -g mlmmj mlmmj 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S mosquitto 2>/dev/null
adduser -S -H -h /var/empty -s /sbin/nologin -D -G mosquitto -g mosquitto mosquitto 2>/dev/null
exit 0
#!/bin/sh
adduser -S -h /var/lib/mpd -s /sbin/nologin -G audio -D -g mpd mpd 2>/dev/null || true
adduser -S -h /var/lib/mpd -s /sbin/nologin -G audio -D -g mpd mpd 2>/dev/null
exit 0
#!/bin/sh
addgroup -S murmur
adduser -S -h /var/lib/murmur -s /sbin/nologin -G murmur -g "Mumble daemon" -H -D murmur
addgroup -S murmur 2>/dev/null
adduser -S -h /var/lib/murmur -s /sbin/nologin -G murmur -g "Mumble daemon" -H -D murmur 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S nagios 2>/dev/null
adduser -S -G nagios -H -h /var/nagios -s /sbin/nologin -g nagios nagios 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -h /etc/ngircd -s /sbin/nologin -D -g ngircd ngircd 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
adduser -S -H -h /dev/null -s /sbin/nologin -D -g nagios nagios 2>/dev/null
addgroup -S nagios 2>/dev/null
exit 0
#!/bin/sh
addgroup -S nsd 2>/dev/null
adduser -S -G nsd -H -h /var/db/nsd -s /sbin/nologin -g nsd nsd 2>/dev/null
exit 0
......@@ -6,4 +6,5 @@ groupname=$username
addgroup -S $username 2>/dev/null
adduser -S -H -h /var/run/$username -s /sbin/nologin -D -G $groupname \
-g $username $username 2>/dev/null
exit 0
#!/bin/sh
addgroup -S ntop 2>/dev/null
adduser -S -h /var/lib/ntop -s /sbin/nologin -G ntop -H -D -g ntop ntop 2>/dev/null
exit 0
#!/bin/sh
addgroup -S vmware 2>/dev/null
exit 0
exit 0
......@@ -2,6 +2,6 @@
# this user should be included in alpine-baselayout-1.2.
# included here for backward compability.
adduser -S -H -h /var/empty -s /sbin/nologin -D -g ntp ntp 2>/dev/null
adduser -S -H -h /var/empty -s /sbin/nologin -D -g ntp ntp 2>/dev/null
exit 0
......@@ -2,10 +2,8 @@
addgroup -S smtpd 2>/dev/null
addgroup -S smtpq 2>/dev/null
adduser -S -H -D -s /sbin/nologin -h /dev/null -g 'SMTP Daemon' -G smtpd smtpd 2>/dev/null
adduser -S -H -D -s /sbin/nologin -h /dev/null -g 'SMTPD Queue' -G smtpq smtpq 2>/dev/null
mkdir -p /var/spool/mail
exit 0
#!/bin/sh
adduser -S -D -H -h /var/empty -s /sbin/false -g opentracker opentracker 2>/dev/null
exit 0
exit 0
......@@ -2,4 +2,5 @@
addgroup -S openvpn 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -G openvpn -g openvpn openvpn 2>/dev/null
exit 0
......@@ -6,4 +6,5 @@ groupname=$username
addgroup -S $username 2>/dev/null
adduser -S -H -h /var/run/$username -s /sbin/nologin -D -G $groupname \
-g $username $username 2>/dev/null
exit 0
#!/bin/sh
adduser -S -H -h /var/cache/pdnsd -s /sbin/nologin -g pdnsd pdnsd 2>/dev/null
exit 0
......@@ -6,5 +6,4 @@ adduser -S -h /var/spool/postfix -G postfix -g postfix postfix 2>/dev/null
addgroup postfix mail 2>/dev/null
adduser -S -H -s /sbin/nologin -h /var/mail/domains -G postdrop -g vmail vmail 2>/dev/null
exit 0
#!/bin/sh
addgroup -S postgrey 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -g postgrey postgrey 2>/dev/null
adduser -S -H -h /dev/null -s /sbin/nologin -D -g postgrey postgrey 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S privoxy 2>/dev/null
adduser -S -G privoxy -h /var/log/privoxy -s /sbin/nologin -D -g privoxy privoxy 2>/dev/null
exit 0
exit 0
#!/bin/sh
getent group kvm >/dev/null || addgroup -S -g 34 kvm
addgroup -S -g 34 kvm 2>/dev/null
exit 0
......@@ -2,5 +2,5 @@
addgroup -S quagga 2>/dev/null
adduser -S -h /var/run/quagga -s /sbin/nologin -D -G quagga -g quagga quagga 2>/dev/null
exit 0
exit 0
......@@ -2,5 +2,5 @@
addgroup -S quagga 2>/dev/null
adduser -S -h /var/run/quagga -s /sbin/nologin -D -G quagga -g quagga quagga 2>/dev/null
exit 0
exit 0
#!/bin/sh
addgroup -S radvd 2>/dev/null
adduser -S -s /sbin/nologin -D -H -G radvd \
-g "Router advertisement (radvd) user" radvd 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S redis 2>/dev/null
adduser -S -H -h /var/lib/redis -s /bin/false -D -G redis -g redis redis 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S rpc 2>/dev/null
adduser -S -h /var/lib/rpcbind -s /sbin/nologin -D -G rpc -g rpc rpc 2>/dev/null
exit 0
......@@ -2,4 +2,5 @@
addgroup -S rt4 2>/dev/null
adduser -S -s /sbin/nologin -G rt4 -D -H -g "Request Tracker 4 user" rt4 2>/dev/null
exit 0