diff options
Diffstat (limited to 'irc/bopm/files/pkg-install.in')
-rw-r--r-- | irc/bopm/files/pkg-install.in | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/irc/bopm/files/pkg-install.in b/irc/bopm/files/pkg-install.in new file mode 100644 index 0000000..10a5a45 --- /dev/null +++ b/irc/bopm/files/pkg-install.in @@ -0,0 +1,48 @@ +#!/bin/sh + +# This script is a modified copy of the pkg-install script +# from the ircd-hybrid-ru port. + +PATH=/bin:/usr/bin:/usr/sbin + +#----------------------------------------------------------------------- +if [ "x$2" = "xPRE-INSTALL" ]; then +#----------------------------------------------------------------------- + +USER=bopm +GROUP=${USER} +UID=717 +GID=${UID} +SHELL=/bin/sh +HOMEDIR=/nonexistent +GECOS="Blitzed Open Proxy Monitor" + +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 ${HOMEDIR} -s ${SHELL} -c "${GECOS}" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi +fi + +#----------------------------------------------------------------------- +fi +#----------------------------------------------------------------------- + +exit 0 |