mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-16 03:24:07 +00:00
f8e7096728
The ntpd daemon implements the Simple Network Time Protocol version 4 as described in RFC 2030 and the Network Time Protocol version 3 as de- scribed in RFC 1305. It can synchronize the local clock to one or more remote NTP servers and act as NTP server itself, redistributing the local time.
36 lines
586 B
Bash
36 lines
586 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
#
|
|
|
|
if [ "$2" != "PRE-INSTALL" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
USER=_ntp
|
|
GROUP=${USER}
|
|
UID=123
|
|
GID=${UID}
|
|
|
|
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
|
|
if pw groupadd ${GROUP} -g ${GID}; then
|
|
echo "Added group \"${GROUP}\"."
|
|
else
|
|
echo "Adding group \"${GROUP}\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
|
|
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
|
-s "/sbin/nologin" -d "/var/empty" \
|
|
-c "NTP daemon"; \
|
|
then
|
|
echo "Added user \"${USER}\"."
|
|
else
|
|
echo "Adding user \"${USER}\" failed..."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
exit 0
|