ports/sysutils/moosefs-master/files/pkg-install.in
Wen Heping e97e3e1752 MooseFS is a fault tolerant, network distributed file system.
mfsmaster is a single machine managing the whole filesystem,
storing metadata for every file (information on size,
attributes and file location(s), including all information
about non-regular files, i.e. directories, sockets, pipes and
devices).

WWW:    http://www.moosefs.org/

Submitted by:	Chifeng Qu <chifeng@gmail.com> (via Email)
2010-04-07 02:54:15 +00:00

37 lines
736 B
Bash

#!/bin/sh
PATH=/bin:/usr/sbin
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
USER=mfs
GROUP=${USER}
UID=925
GID=${UID}
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d /nonexistent -s /sbin/nologin -c "MySQL Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0