summaryrefslogtreecommitdiff
path: root/mail/biffer/pkg-install
blob: e4b3b5d682efa245fe10bbc6b577119685f64a5f (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
45
46
#!/bin/sh

if [ x$2 != xPOST-INSTALL ]; then
  exit
fi

needHUP="no"

echo -n "/etc/services needs to mention biffer, checking... "
egrep '^biffer[[:space:]]+1243/tcp' /etc/services > /dev/null
if [ $? -eq 0 ]; then
  echo "already there"
else
  echo "adding entry"
  echo 'biffer		1243/tcp	# biffer(8) under inetd' >> \
    /etc/services
fi

echo -n "/etc/inetd.conf needs to mention biffer, checking... "
egrep '^biffer[[:space:]]+stream' /etc/inetd.conf > /dev/null
if [ $? -eq 0 ]; then
  echo "already there"
else
  echo "adding entry"
  echo "biffer	stream	tcp	nowait	root	${PKG_PREFIX}/libexec/biffer	biffer" >> /etc/inetd.conf
  needHUP="yes"
fi

echo -n "/etc/inetd.conf needs to mentionn biffer_comsat, checking... "
egrep '^comsat[[:space:]]+.*[[:space:]]+biffer_comsat' /etc/inetd.conf > /dev/null
if [ $? -eq 0 ]; then
  echo "already there"
else
  echo "adding entry"
  echo "comsat	stream	tcp	nowait	root	${PKG_PREFIX}/libexec/biffer_comsat	biffer_comsat" >> /etc/inetd.conf
  needHUP="yes"
fi

if [ "$needHUP" = "yes" ]; then
  echo
  echo "------------------------------------------------------------------"
  echo "inetd(8) needs to re-read /etc/inetd.conf. Please either kill -HUP"
  echo "the inetd process, or reboot to allow biffer(8) to work."
  echo "------------------------------------------------------------------"
  echo
fi