2001-04-07 02:13:55 +00:00
|
|
|
#!/bin/sh
|
2001-04-10 10:52:20 +00:00
|
|
|
# $FreeBSD$
|
2001-04-07 02:13:55 +00:00
|
|
|
|
|
|
|
[ $# != 2 ] && exit 1
|
|
|
|
PKGNAME=$1
|
|
|
|
ACTION=$2
|
|
|
|
|
|
|
|
CONF_DIR=${PKG_PREFIX}/etc
|
|
|
|
|
|
|
|
CONF_FILE=op.access
|
|
|
|
CONF_OWN=root
|
|
|
|
CONF_GRP=wheel
|
|
|
|
CONF_MODE=400
|
|
|
|
|
|
|
|
SAMP_SUFX=.sample
|
|
|
|
|
|
|
|
INSTALL=install
|
|
|
|
CMP=cmp
|
|
|
|
RM=rm
|
|
|
|
|
2001-08-21 15:29:13 +00:00
|
|
|
case "$ACTION" in
|
2001-04-07 02:13:55 +00:00
|
|
|
|
|
|
|
POST-INSTALL)
|
|
|
|
if [ -f ${CONF_DIR}/${CONF_FILE} ]; then
|
|
|
|
echo "$PKGNAME: Will not overwrite existing ${CONF_DIR}/${CONF_FILE} file."
|
|
|
|
else
|
|
|
|
${INSTALL} -c -o ${CONF_OWN} -g ${CONF_GRP} -m ${CONF_MODE} \
|
2001-08-21 15:29:13 +00:00
|
|
|
${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} \
|
2001-04-07 02:13:55 +00:00
|
|
|
${CONF_DIR}/${CONF_FILE}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
DEINSTALL)
|
2001-08-21 15:29:13 +00:00
|
|
|
if ${CMP} -s ${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} \
|
2001-04-07 02:13:55 +00:00
|
|
|
${CONF_DIR}/${CONF_FILE}; then
|
|
|
|
${RM} -f ${CONF_DIR}/${CONF_FILE}
|
|
|
|
else
|
|
|
|
echo "$PKGNAME: Will not remove existing ${CONF_DIR}/${CONF_FILE} file."
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
PRE-INSTALL|POST-DEINSTALL)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit
|