#!/bin/sh

if [ ! -r /usr/lib/libwrap.a ]; then
	exit 0
fi

x=`ar t /usr/lib/libwrap.a setenv.o 2> /dev/null`
if [ "$x" = 'setenv.o' ]; then
	echo
	echo "HANG ON..."
	echo
	echo "Your tcp_wrappers library contains an implementation of"
	echo "setenv(3) which is not needed and which may cause problems"
	echo "with programs which inadvertantly use this instead of the"
	echo "implementation in libc."
	echo
	echo "Do you wish to remove the version from your tcp_wrappers lib?"
	echo "Please enter Y or N"
	while read x; do
		case "$x" in
			Y*|y*)
				ar d /usr/lib/libwrap.a setenv.o
				echo "Removed successfully"
				exit 0
				;;
			N*|n*)
				echo "Ok. It is still there. Good luck."
				exit 0
				;;
			*)
				echo "Please enter Y or N"
				;;
		esac
	done
fi
