PREUN
/bin/sh
### RUN CHKCONFIG ###
/sbin/chkconfig --del atalk
POSTIN
/bin/sh
### RUN CHKCONFIG ###
/sbin/chkconfig --add atalk
/sbin/ldconfig
# after the first install only
if [ "$1" = 1 ]; then
# add the ddp lines to /etc/services
if (grep '[0-9][0-9]*/ddp' /etc/services >/dev/null); then
cat <<'_EOD1_' >&2
warning: The DDP services appear to be present in /etc/services.
warning: Please check them against services.atalk in the documentation.
_EOD1_
true
else
cat <<'_EOD2_' >>/etc/services
# start of DDP services
#
# Everything between the 'start of DDP services' and 'end of DDP services'
# lines will be automatically deleted when the netatalk package is removed.
#
rtmp 1/ddp # Routing Table Maintenance Protocol
nbp 2/ddp # Name Binding Protocol
echo 4/ddp # AppleTalk Echo Protocol
zip 6/ddp # Zone Information Protocol
afpovertcp 548/tcp # AFP over TCP
afpovertcp 548/udp
# end of DDP services
_EOD2_
fi
fi
POSTUN
/bin/sh
# do only for the last un-install
if [ "$1" = 0 ]; then
# remove the ddp lines from /etc/services
if (grep '^# start of DDP services$' /etc/services >/dev/null && \
grep '^# end of DDP services$' /etc/services >/dev/null ); then
sed -e '/^# start of DDP services$/,/^# end of DDP services$/d' \
</etc/services >/etc/services.tmp$$
cat /etc/services.tmp$$ >/etc/services
rm /etc/services.tmp$$
else
cat <<'_EOD3_' >&2
warning: Unable to find the lines `# start of DDP services` and
warning: `# end of DDP services` in the file /etc/services.
warning: You should remove the DDP services from /etc/services manually.
_EOD3_
fi
fi