diff options
author | Przemyslaw Pawelczyk <przemoc@zoho.com> | 2016-04-23 13:13:39 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-04-25 06:55:43 +0000 |
commit | a60b9f07dee0ae4e9bbe34d4146661fcb33aa478 (patch) | |
tree | f72d97073ee32bd15b5b0a913f108b144778af1c /main/alpine-baselayout | |
parent | a593d306c92f8bc15a1797c0a2ccfa784edbc4a0 (diff) | |
download | aports-a60b9f07dee0ae4e9bbe34d4146661fcb33aa478.tar.bz2 aports-a60b9f07dee0ae4e9bbe34d4146661fcb33aa478.tar.xz |
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.
Diffstat (limited to 'main/alpine-baselayout')
-rw-r--r-- | main/alpine-baselayout/alpine-baselayout.pre-install | 5 | ||||
-rw-r--r-- | main/alpine-baselayout/alpine-baselayout.pre-upgrade | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/main/alpine-baselayout/alpine-baselayout.pre-install b/main/alpine-baselayout/alpine-baselayout.pre-install index 3b9f141083..fc0d0b9f5d 100644 --- a/main/alpine-baselayout/alpine-baselayout.pre-install +++ b/main/alpine-baselayout/alpine-baselayout.pre-install @@ -1,6 +1,5 @@ #!/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 diff --git a/main/alpine-baselayout/alpine-baselayout.pre-upgrade b/main/alpine-baselayout/alpine-baselayout.pre-upgrade index 8a7098f7d1..f7c8db83c4 100644 --- a/main/alpine-baselayout/alpine-baselayout.pre-upgrade +++ b/main/alpine-baselayout/alpine-baselayout.pre-upgrade @@ -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 |