postinst is in talkd 0.17-15build2.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 48 49 50 51 52 53 54 | #!/bin/sh
set -e
enable_talk() {
update-inetd --pattern '[ \t]/usr/sbin/in\.talkd' --enable talk
update-inetd --pattern '[ \t]/usr/sbin/in\.ntalkd' --enable ntalk
}
remove_talk() {
update-inetd --remove "$talkp"
update-inetd --remove "$ntalkp"
}
talkp='talk[ \t].*[ \t]/usr/sbin/in.talkd'
ntalkp='ntalk[ \t].*[ \t]/usr/sbin/in.ntalkd'
case "$1" in
abort-upgrade | abort-deconfigure | abort-remove)
enable_talk
;;
configure)
if [ -n "$2" ] && dpkg --compare-versions "$2" ge 0.16-1; then
enable_talk
else
talk_entry="talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd"
ntalk_entry="ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd"
if grep "$talkp" /etc/inetd.conf | grep -q '^#'; then
talk_entry=\#$talk_entry
fi
if grep "$ntalkp" /etc/inetd.conf | grep -q '^#'; then
ntalk_entry=\#$ntalk_entry
fi
remove_talk
if
[ -n "${talk_entry###*}" ] &&
grep -q ^talk /etc/inetd.conf
then
talk_entry=\#$talk_entry
fi
if
[ -n "${ntalk_entry###*}" ] &&
grep -q ^ntalk /etc/inetd.conf
then
ntalk_entry=\#$ntalk_entry
fi
update-inetd --group BSD --add "$talk_entry"
update-inetd --group BSD --add "$ntalk_entry"
fi
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
|