1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-29 21:39:24 +00:00
freebsd-ports/japanese/ndtpd/pkg-install
Satoshi Asami 7810fb706b Upgrade to ndtpd-2.3.2 and eb-2.3.2. PR was for ndtpd-2.3.1 and
eb-2.3, I changed the versions and recalculated the checksums.

Also, ndtpd/patches/patch-aa (by me) is for quieting ndtpd somewhat so
it won't leave dozens of lines to /var/log/messages every time someone
looks up a word, and eb/patches/patch-aa (by Kasahara-san, the
original author) is for changing the shared lib versions.
ndtpd/Makefile's LIB_DEPENDS was adjusted accordingly.

PR:		12130
Submitted by:	maintainer
Reviewed (my changes) by: maintainer
1999-08-19 10:50:30 +00:00

62 lines
1.4 KiB
Bash

#!/bin/sh -
# an installation script for ndtpd
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" ]; then
read -p "${question} (y/n) [${default}]? " answer
[ "${answer}" ] && default=${answer}
fi
echo ${default}
}
yesno() {
local question default
question=$1
default=$2
while :; do
case `ask "${question}" ${default}` in
[Yy]*) return 0;;
[Nn]*) return 1;;
esac
echo "Please answer yes or no."
done
}
[ "$2" = POST-INSTALL ] || exit 0
#
# Add an entry for `ndtp' to /etc/services.
#
file=/etc/services
back=${file}.bak
name=ndtp
port=2010/tcp
comment="Network Dictionary Transfer Protocol"
echo "************************************************************************"
if sed 's/#.*//' ${file} | grep -qw ${name}; then
echo "This system has already an entry for ${name} in ${file}."
else
echo "This system has no entry for ${name} in ${file}."
if yesno " Would you like to add it automatically?" y; then
cp -f ${file} ${back}
echo " The original file is saved as ${back}."
if sed 's/#.*//' ${file} | grep -qw ${port}; then
sed 's,^\([^#]*[ ]'${port}'\),\1 '${name}, ${back} > ${file}
else
echo "${name} ${port} #${comment}" >> ${file}
fi
fi
fi
echo "************************************************************************"
exit 0