- # make sure that the correct user and group are present:
- id_monkeysphere=`id -u monkeysphere 2> /dev/null`
- gid_monkeysphere=`getent group monkeysphere | cut -f3 -d: 2> /dev/null`
- if [ X"$id_monkeysphere" = X641 ] && [ X"$gid_monkeysphere" = X641 ];then
- exit 0
- else
- # add an account 'monkeysphere' to this system
- echo ""
- echo "You need an account 'monkeysphere' whose ID number is 641, with group 'monkeysphere' (GID 641)"
- if yesno "Would you like to create it automatically?" y; then
- # We need a command 'pw(8)'
- check_pw
- pw groupadd monkeysphere -g 641 || failure $?
- pw useradd monkeysphere -u 641 -g 641 -h - -d "$VARLIB" \
- -s /bin/sh -c 'monkeysphere authentication user,,,' || failure $?
- # FIXME: should we really be using a real shell? Convention
- # (/usr/ports/UIDs) seems to indicate /nonexistent is
- # preferred
- else
- echo "Please create it, and try again."
- exit 1
- fi
- fi
- # FIXME: we should create $VARLIB and chown the relevant subdirs
- # (see debian/monkeysphere.postinst)
-
- ;;