#! /bin/sh
#
#  This script is called by the installer package after
#  installation has completed.
#
#  The first argument is the absolute pathname of the Installer
#  package when the program is invokedPfor example,
#  /MyAppDisk#1/MyApp.pkg.  
#
#  The second argument is the absolute pathname of the location where
#  the contents of the package will be installed, for example,
#  /LocalApps or /Net/Server/User/Apps. 
#
#  We must exit with 0 if successful and we should echo
#  progress to stdout.
#
#  For PPP.preferences we must set the SUID bit on the original Preferences
#  executable, so that the PPP module be able to kill the pppd daemon.
#
PATH=/bin:/etc
PREFERENCES=/NextApps/Preferences.app/Preferences
echo "Setting SUID bit on ${PREFERENCES}"
if [ -f ${PREFERENCES} ]; then
	chown root ${PREFERENCES}
	chmod u+s ${PREFERENCES}
	if [ -u ${PREFERENCES} ]; then
		echo "OK"
		exit 0
	else
		echo "FAILED (Unable to set SUID bit on ${PREFERENCES}"
		exit 1
	fi
else
	echo "FAILED (Unable to locate ${PREFERENCES})"
	exit 2
fi