#!/bin/sh set -e PATH="/sbin:/bin:/usr/sbin:/usr/bin" PACKAGE=$(basename $0 | sed 's/\..*//') pkgdir=/usr/share/$PACKAGE conf=/etc/inetd.conf port="www" entry= Debhelper () { : # Automatically added by dh_installsystemd/13.10 if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then deb-systemd-invoke stop 'micro-httpd.socket' >/dev/null || true fi # End automatically added section } Which () { which "$1" > /dev/null 2>&1 } Die () { echo "$0: $*" >&2 exit 1 } IsInetd () { which update-inetd > /dev/null 2>&1 } IsInetdConf () { [ -f $conf ] } InetdName () { local name= if [ -f /etc/init.d/inetutils-inetd ]; then name=inetutils-inetd elif [ -f /etc/init.d/openbsd-inetd ]; then name="openbsd-inetd" elif [ -f /etc/init.d/rlinetd ]; then name="rlinetd" fi [ ! "$name" ] || echo $name } CallInetd () { local name=$1 local cmd=$2 [ "$cmd" ] || return 0 if Which invoke-rc.d ; then invoke-rc.d $name $cmd else /etc/init.d/$name $cmd fi } MainInetd () { if [ "$1" = "remove" ]; then echo "$0: removing $conf entry" >&2 update-inetd --remove "$port.*$PACKAGE" local name=$(InetdName) CallInetd $name reload fi } Main () { if IsInetd ; then MainInetd "$@" fi Debhelper } Main "$@" # End of file