mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
system/mongodb: If user/group doesn't exist, exit 1.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
035396b379
commit
a0d9c15065
1 changed files with 7 additions and 15 deletions
|
@ -68,10 +68,8 @@ fi
|
|||
|
||||
set -e
|
||||
|
||||
# Bail if user or group isn't valid on your system
|
||||
if ! getent passwd mongo 1>/dev/null 2>/dev/null; then
|
||||
|
||||
cat << EOF
|
||||
bailout() {
|
||||
cat << EOF
|
||||
|
||||
You must have a mongo user to run this script
|
||||
|
||||
|
@ -79,18 +77,12 @@ cat << EOF
|
|||
# useradd -u $MONGO_USER -d /var/lib/$PRGNAM -s /bin/false -g mongo mongo
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
exit
|
||||
elif ! getent group mongo 1>/dev/null 2>/dev/null; then
|
||||
|
||||
cat << EOF
|
||||
|
||||
You must have a mongo group to run this script
|
||||
# groupadd -g $MONGO_GROUP mongo
|
||||
|
||||
EOF
|
||||
exit
|
||||
fi
|
||||
# Bail if user or group isn't valid on your system
|
||||
getent passwd mongo &>/dev/null || bailout
|
||||
getent group mongo &>/dev/null || bailout
|
||||
|
||||
rm -fr $TMP/$SRC_FLDR $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
|
|
Loading…
Reference in a new issue