#! /bin/sh
# postinst script for root-daemon
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)
	# Install lines in /etc/inetd.conf for ROOT daemon services
	# The rootd for remote file acces
	update-inetd --group OTHER --add \
	    'rootd\tstream\ttcp\tnowait\troot\t@prefix@/bin/rootd\trootd -i'
	# The PROOF daemon for Parallel computing
	update-inetd --group OTHER --add \
	    'proofd\tstream\ttcp\tnowait\troot\t@prefix@/bin/proofd\tproofd\t@prefix@/share/root'
	
	# Install lines in /etc/services - should not be done here, rather
        # the lines should be added by netbase maintainer. Will ask for 
	# these at some later point. 
	if ! grep -qs ^proofd /etc/services ; then
	    echo "proofd          1093/tcp # ROOT"   >> /etc/services
	fi
	if ! grep -qs ^rootd /etc/services ; then
                echo "rootd       1094/tcp # ROOT"  >> /etc/services
        fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    # Nothing to be done here
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


