diff options
Diffstat (limited to 'security/sudo/pkg/DEINSTALL')
-rw-r--r-- | security/sudo/pkg/DEINSTALL | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/security/sudo/pkg/DEINSTALL b/security/sudo/pkg/DEINSTALL new file mode 100644 index 00000000000..92722a32e51 --- /dev/null +++ b/security/sudo/pkg/DEINSTALL @@ -0,0 +1,59 @@ +#!/bin/sh +# +# $NetBSD: DEINSTALL,v 1.1 2000/12/06 06:33:40 jlam Exp $ + +PKGNAME=$1 +STAGE=$2 + +SAMPLECONFDIR=${PKG_PREFIX}/share/examples/sudo +CONFDIR=/etc +CONFFILES="sudoers" + +case ${STAGE} in +DEINSTALL) + # Remove configuration files if they don't differ from the default + # config file. + # + for file in ${CONFFILES} + do + FILE=${CONFDIR}/${file} + SAMPLEFILE=${SAMPLECONFDIR}/${file} + if diff -q ${FILE} ${SAMPLEFILE} >/dev/null + then + rm -f ${FILE} + fi + done + ;; +POST-DEINSTALL) + modified_files='' + for file in ${CONFFILES} + do + FILE=${CONFDIR}/${file} + if [ -f ${FILE} ] + then + modified_files="${modified_files} ${FILE}" + fi + done + if [ -n "${modified_files}" ] + then + cat << EOF +=========================================================================== +If you won't be using ${PKGNAME} any longer, you may want to remove the +following files: + +EOF + for file in ${modified_files} + do + echo " ${file}" + done + cat << EOF +=========================================================================== +EOF + fi + ;; +*) + echo "Unexpected argument: ${STAGE}" + exit 1 + ;; +esac +exit 0 |