Your IP : 18.219.8.51


Current Path : /usr/local/mgr5/sbin/
Upload File :
Current File : //usr/local/mgr5/sbin/pkgremove.sh

#!/bin/sh

if [ "$1" = "-T" ]; then
	echo -n "(c) ISPsystem.com"
	exit 0
fi
LD_LIBRARY_PATH=""
export DEBIAN_FRONTEND=noninteractive
echo >> var/pkg.log
echo -n "*** " >> var/pkg.log
date >> var/pkg.log
RDEPS=$(apt-cache rdepends --installed ${1} | grep -E '^\s+\|' | sed 's/\s//; s/|//' | xargs)
echo "*** removing $1 with rdepends ${RDEPS}" >> var/pkg.log
/usr/bin/apt-get -qy purge $1 ${RDEPS}>> var/pkg.log 2>&1
exitcode=$?
if [ -n "$2" ] && [ -n "$3" ]; then
	sbin/mgrctl -m $2 $3 elid=$1 result=$exitcode
fi
exit $exitcode