Bump Standard Version to 3.8.1 and Compat Version to 5
[grml-autoconfig.git] / debian / postinst
index 2e94284..3783fbe 100755 (executable)
@@ -6,9 +6,11 @@ if [ "$1" = "configure" ]; then
 
 # begin of "create special init scripts which won't be touched any more by grml"
 . /etc/grml/lsb-functions
+DATE=$(date)
+
+# bootup
 INITSCRIPT=bootlocal
 INITNAME=/etc/init.d/${INITSCRIPT}
-DATE=$(date)
 
 for initscript in ${INITNAME}.first ${INITNAME}.middle ${INITNAME}.last ; do
   if ! [ -r "$initscript" ] ; then
@@ -34,8 +36,39 @@ done
 update-rc.d ${INITSCRIPT}.first  start 1  S . >/dev/null
 update-rc.d ${INITSCRIPT}.middle start 29 2 . >/dev/null
 update-rc.d ${INITSCRIPT}.last   start 99 2 . >/dev/null
-# end of "create special init scripts which won't be touched any more by grml"
 
+# shutdown
+INITSCRIPT=haltlocal
+INITNAME=/etc/init.d/${INITSCRIPT}
+
+for initscript in ${INITNAME}.first ${INITNAME}.middle ${INITNAME}.last ; do
+  if ! [ -r "$initscript" ] ; then
+     einfo "Creating ${initscript}"
+  cat >$initscript <<EOT
+#!/bin/sh
+# Filename:      $initscript
+# Purpose:       script which allows manual configuration of shutdown process
+# Latest change: $DATE
+################################################################################
+# Notice: you can modify this file as you like as long as you do not rename it!
+# grml won't touch this file, even not on upgrades. It will be created only
+# once - when the file isn't present at all.
+################################################################################
+
+## END OF FILE #################################################################
+EOT
+  chmod 755 $initscript; eend $?
+  fi
+done
+
+# register initscripts via update-rc.d:
+update-rc.d ${INITSCRIPT}.first  stop 1  0 1 6 . >/dev/null
+update-rc.d ${INITSCRIPT}.middle stop 29 0 1 6 . >/dev/null
+update-rc.d ${INITSCRIPT}.last   stop 99 0 1 6 . >/dev/null
+
+# end of "create special init scripts which won't be touched any more by grml"
 fi
 
+#DEBHELPER#
+
 exit 0