mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-14 23:46:10 +00:00
28ca7dd503
tar as root. PR: 15577 Submitted by: AnarCat <beaupran@iro.umontreal.ca>
39 lines
955 B
Bash
39 lines
955 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"
|
|
/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/*
|