blob: cd290e7faf5cc84ee299b570ba059e55ea6d3b34 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh
#
# Night Light IRC Proxy
# Installation 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"
UID="118"
GID="118"
if [ "$2" = "POST-INSTALL" ]; then
pw group show ${EGROUP} >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
pw groupadd ${EGROUP} -g ${GID}
fi
pw user show ${EUSER} >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
pw useradd ${EUSER} -u ${UID} -g ${EGROUP} -s /nonexistent -c "Night Light IRC Proxy"
fi
sed -i -e "s:^IRCPROXYBINFILE=.*:IRCPROXYBINFILE=${PKG_PREFIX}/sbin/${BINFILE}:" ${PKG_PREFIX}/sbin/ircproxy.sh || exit 1
sed -i -e "s:^IRCPROXYPIDFILE=.*:IRCPROXYPIDFILE=${PIDFILE}:" ${PKG_PREFIX}/sbin/ircproxy.sh || exit 1
rm -f ${PKG_PREFIX}/sbin/ircproxy.sh-e
#grep -q "^[^#]*${PKG_PREFIX}/sbin/ircproxy\.sh" /etc/crontab >/dev/null 2>&1
#if [ ! $? -eq 0 ] ; then
# cat <<EOF >>/etc/crontab || exit 1
#*/5 * * * * root $PKG_PREFIX/sbin/ircproxy.sh
#EOF
#fi
fi
exit 0
|