3a8f5e82e4
- Fix error when changing ownership of spool directory Changelog prelude-manager 0.9.9: - Update configuration template, add documentation for Prelude generic TCP options. - Implement modified patch from Pierre Chifflier <chifflier@inl.fr> to fix the example log path (fix #224). - Move IDMEF message normalization in the scheduler, rather than doing it upon reception. This remove some load from the server and allow Prelude-Manager own IDMEF messages to go through the normalizer path. - Implement heartbeat->analyzer normalization. - Improve IPv4 / IPv6 address normalization. IPv4 mapped IPv6 addresses are now mapped back to IPv4. Additionally, the Normalize plugin now provide two additionals option: ipv6-only: Map any incoming IPv4 address to IPv6. keep-ipv4-mapped-ipv6: do not map IPv4 mapped IPv6 addresses back to IPv4. - Make a difference between exceptional report plugin failure (example: a single message couldn't be processed) and "global" plugin failure (example: database server is down). We use a different failover for 'exceptional' failure, so that we don't try to reinsert a bogus message (fix #247). - Start of a Prelude-Manager manpages (#236). - Various bug fixes. PR: ports/115233 Submitted by: maintainer (Robin Gruyters)
74 lines
1.9 KiB
Bash
74 lines
1.9 KiB
Bash
#!/bin/sh -
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PRELUDEDIR=%%PRELUDEDIR%%
|
|
PRELUDEUSER=%%PRELUDEUSER%%
|
|
PRELUDEGROUP=%%PRELUDEGROUP%%
|
|
PRELUDEUID=%%PRELUDEUID%%
|
|
PRELUDEGID=%%PRELUDEGID%%
|
|
|
|
ask() {
|
|
local question default answer
|
|
|
|
question=$1
|
|
default=$2
|
|
if [ -z "${PACKAGE_BUILDING}" ]; then
|
|
read -p "${question} [${default}]? " answer
|
|
fi
|
|
if [ "x${answer}" = "x" ]; then
|
|
answer=${default}
|
|
fi
|
|
echo ${answer}
|
|
}
|
|
|
|
yesno() {
|
|
local default question answer
|
|
|
|
question=$1
|
|
default=$2
|
|
while :; do
|
|
answer=$(ask "${question}" "${default}")
|
|
case "${answer}" in
|
|
[Yy][Ee][Ss]|[Yy])
|
|
return 0
|
|
;;
|
|
[Nn][Oo]|[Nn])
|
|
return 1
|
|
;;
|
|
esac
|
|
echo "Please answer yes or no."
|
|
done
|
|
}
|
|
|
|
if [ "$2" = "PRE-INSTALL" ]; then
|
|
if /usr/sbin/pw group show "${PRELUDEGROUP}" 2>&1 >/dev/null; then
|
|
echo "You already have a \"${PRELUDEGROUP}\" group, so I will use it."
|
|
else
|
|
echo "You need a \"${PRELUDEGROUP}\" group."
|
|
if yesno "Would you like me to create it" "YES"; then
|
|
/usr/sbin/pw groupadd "${PRELUDEGROUP}" -g "${PRELUDEGID}" -h - || \
|
|
/usr/sbin/pw groupadd "${PRELUDEGROUP}" -h - || exit
|
|
echo "Done."
|
|
else
|
|
echo "Please create the \"${PRELUDEGROUP}\" group manually and try again."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if /usr/sbin/pw user show "${PRELUDEUSER}" 2>&1 >/dev/null; then
|
|
echo "You already have a \"${PRELUDEUSER}\" user, so I will use it."
|
|
else
|
|
echo "You need a \"${PRELUDEUSER}\" user."
|
|
if yesno "Would you like me to create it" "YES"; then
|
|
/usr/sbin/pw useradd "${PRELUDEUSER}" -u "${PRELUDEUID}" -g "${PRELUDEGROUP}" -h - -d "${PRELUDEDIR}" \
|
|
-s /sbin/nologin -c "Prelude pseudo-user" || \
|
|
/usr/sbin/pw useradd "${PRELUDEUSER}" -g "${PRELUDEGROUP}" -h - -d "${PRELUDEDIR}" \
|
|
-s /sbin/nologin -c "Prelude pseudo-user" || exit
|
|
else
|
|
echo "Please create the \"${PRELUDEUSER}\" user manually and try again."
|
|
exit 1
|
|
fi
|
|
fi
|
|
fi
|