mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-11 02:50:24 +00:00
620d4f39c3
- Added files/interchange.sh.in - Removed files/interchange.sh PR: ports/108665 Submitted by: loader <loader at freebsdmall.com> (maintainer) Approved by: alexbl (mentor, implicit)
48 lines
1.2 KiB
Bash
48 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
USER=interch
|
|
GROUP=${USER}
|
|
UID=95
|
|
GID=${UID}
|
|
|
|
case $2 in
|
|
PRE-INSTALL)
|
|
USER=interch
|
|
GROUP=${USER}
|
|
UID=95
|
|
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 "${PKG_PREFIX}/interchange" \
|
|
-s /bin/sh -c "Interchange user"
|
|
then
|
|
echo "Added user \"${USER}\"."
|
|
else
|
|
echo "Adding user \"${USER}\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
;;
|
|
POST-INSTALL)
|
|
/usr/bin/install -d -m 755 -o ${USER} -g ${GROUP} /var/run/interchange
|
|
/usr/sbin/chown -R ${USER}:${GROUP} ${PKG_PREFIX}/interchange
|
|
;;
|
|
esac
|