mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-28 01:06:17 +00:00
4277490fef
- Disable automatical crontab editing PR: ports/102826 Submitted by: Jonas Kvinge <jonas@emptyglass.night-light.net> (maintainer)
57 lines
1.2 KiB
Bash
57 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Night Light IRC Proxy
|
|
# Deinstallation script for FreeBSD ports
|
|
# Written by Jonas Kvinge
|
|
#
|
|
# Last modified: Jonas Kvinge (03.09.2006)
|
|
#
|
|
|
|
BINFILE=ircproxyd
|
|
PIDFILE="/var/run/ircproxyd.pid"
|
|
EUSER="ircproxy"
|
|
EGROUP="ircproxy"
|
|
|
|
if [ "$2" = "DEINSTALL" ]; then
|
|
|
|
#grep -q "^[^#]*${PKG_PREFIX}/sbin/ircproxy\.sh" /etc/crontab >/dev/null 2>&1
|
|
#if [ $? -eq 0 ]; then
|
|
# sed -i -e "s:^[^#]*${PKG_PREFIX}/sbin/ircproxy\.sh::" /etc/crontab
|
|
# sed -i -e '/^$/d' /etc/crontab
|
|
# rm -f /etc/crontab-e
|
|
#fi
|
|
|
|
if [ -f $PIDFILE ] && [ -r $PIDFILE ] ; then
|
|
PID=`cat "$PIDFILE"`
|
|
ps -p "$PID" >/dev/null 2>&1
|
|
if [ $? -eq 0 ]; then
|
|
for count in 1 2 3 4 5 6 7 8 9 10; do
|
|
if [ $count -ge 5 ]; then
|
|
kill -KILL "$PID" || break
|
|
break
|
|
fi
|
|
kill -TERM "$PID" || break
|
|
sleep 2
|
|
ps -p "$PID" >/dev/null 2>&1
|
|
if [ ! $? -eq 0 ]; then
|
|
break;
|
|
fi
|
|
done
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$2" = "POST-DEINSTALL" ]; then
|
|
|
|
pw group show ${EGROUP} >/dev/null 2>&1
|
|
if [ $? -eq 0 ] ; then
|
|
pw groupdel -n "$EGROUP"
|
|
fi
|
|
pw user show ${EUSER} >/dev/null 2>&1
|
|
if [ $? -eq 0 ] ; then
|
|
pw userdel -n "$EUSER"
|
|
fi
|
|
fi
|
|
|
|
exit 0
|