1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00
freebsd-ports/misc/amanda/pkg-install

39 lines
955 B
Plaintext
Raw Normal View History

#! /bin/sh
if [ "X$2" != "XPOST-INSTALL" ]; then
exit 0
fi
echo -n "Adding necessary groups and modifying permissions on "
echo "${PKG_PREFIX}/libexec/amanda dir"
group=amanda
if pw groupshow "${group}" 2>/dev/null; then
echo "You already have a group \"${group}\", so I will use it."
else
echo "You need a group \"${group}\"."
if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
read -p "Would you like me to create it? [Y] " ans
fi
if [ x$ans = x ]; then
ans=y
fi
case "$ans" in
[Yy]*)
pw groupadd ${group} -h - || exit
echo "Done."
;;
*)
echo "Please create it, and try again."
exit 1
;;
esac
fi
echo "Modifying permissions on ${PKG_PREFIX}/libexec/amanda"
/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda
/bin/chmod 510 ${PKG_PREFIX}/libexec/amanda
/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda/*
/bin/chmod 4550 ${PKG_PREFIX}/libexec/amanda/*