1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-05 22:43:24 +00:00
freebsd-ports/misc/amanda/pkg-install
Kris Kennaway c0dffc9cf7 /sbin/chown -> /usr/sbin/chown
Submitted by:	Patrick Oonk <patrick@pine.nl>
2000-05-15 07:32:48 +00:00

39 lines
963 B
Bash

#! /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"
/usr/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda
/bin/chmod 510 ${PKG_PREFIX}/libexec/amanda
/usr/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda/*
/bin/chmod 4550 ${PKG_PREFIX}/libexec/amanda/*