#!/bin/sh 
set -e
install-info --quiet --section Development Development \
  /usr/share/info/hello.info

# Setup the config file
if [ -e /etc/default/hello ] ; then
   sed -e 's/=no/=yes/' </etc/default/hello >/tmp/hello_default.$$
   mv /tmp/hello_default.$$ /etc/default/hello
else
   echo -e "start=no\n">>/etc/default/hello
fi

# Install the daemon
if [ "$1" = "configure" ]
then
  if [ -f /etc/init.d/hello ]
  then
	  set +e
	  if [ -x /usr/sbin/invoke-rc.d ]
	  then
		  invoke-rc.d hello stop
	  else
		  sh /etc/init.d/hello stop
	  fi
	  set -e
  fi

  update-rc.d hello defaults 10 90 >/dev/null
  if [ -f /etc/init.d/hello ]
    then
        set +e
        if [ -x /usr/sbin/invoke-rc.d ]
        then
            invoke-rc.d hello start
        else
            sh /etc/init.d/hello start
        fi
        set -e
    fi
fi


