File: postinst

package info (click to toggle)
ircd 2.10.04-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,248 kB
  • ctags: 2,145
  • sloc: ansic: 26,591; makefile: 666; sh: 418; perl: 18
file content (47 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download
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
47
#!/bin/sh -e
if [ "$1" != "configure" ]
then
    exit 0
fi
touch /var/log/ircd/opers || true
touch /var/log/ircd/users || true
echo -n "Checking existing ircd configuration ... "
CUST="/etc/ircd/ircd.conf /etc/ircd/ircd.motd"
HOST="`hostname --fqdn`"
if [ -e /etc/news/organization ]; then
	NAME="`cat /etc/news/organization`"
else
	NAME="The World Domination Project"
fi
for i in $CUST; do
	cp $i $i.new
	sed < $i.new > $i -e "s#HOST#$HOSTg" -e "s#NAME#$NAMEg"
	rm $i.new
done
if [ ! -f /etc/ircd/remote.motd ]
then
    cp /etc/ircd/ircd.motd /etc/ircd/remote.motd
fi
echo "done."
if ! grep "^irc:" /etc/passwd > /dev/null
then
    echo -n "IRC user not found in /etc/passwd.  Fix?  [y/N] "
    read $REPLY
    if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]
    then
	echo "Running adduser --system irc ..."
	adduser --system irc
    else
	exit 0
    fi
fi
chown -R irc /var/log/ircd /etc/ircd
# Permission processing inserted by debmake on Sat, 15 Nov 1997 19:50:19 -0500
if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then
	suidregister -s ircd /usr/sbin/ircd irc root 6754
else
	chown irc.root /usr/sbin/ircd || true
	chmod 6754 /usr/sbin/ircd || true
fi
update-inetd --comment-chars "#disabled#" --disable ircd
update-inetd --add "ircd            stream  tcp     wait    irc     /usr/sbin/ircd ircd -i"