Added tag 0.8.5 for changeset ec4b09935e1e
[grml-autoconfig.git] / debian / postinst
1 #!/bin/sh
2 set -e
3
4 if [ "$1" = "configure" ]; then
5   update-rc.d grml-autoconfig start 30 2 . >/dev/null
6
7 # begin of "create special init scripts which won't be touched any more by grml"
8 . /etc/grml/lsb-functions
9 INITSCRIPT=bootlocal
10 INITNAME=/etc/init.d/${INITSCRIPT}
11 DATE=$(date)
12
13 for initscript in ${INITNAME}.first ${INITNAME}.middle ${INITNAME}.last ; do
14   if ! [ -r "$initscript" ] ; then
15      einfo "Creating ${initscript}"
16   cat >$initscript <<EOT
17 #!/bin/sh
18 # Filename:      $initscript
19 # Purpose:       script which allows manual configuration of bootup process
20 # Latest change: $DATE
21 ################################################################################
22 # Notice: you can modify this file as you like as long as you do not rename it!
23 # grml won't touch this file, even not on upgrades. It will be created only
24 # once - when the file isn't present at all.
25 ################################################################################
26
27 ## END OF FILE #################################################################
28 EOT
29   chmod 755 $initscript; eend $?
30   fi
31 done
32
33 # register initscripts via update-rc.d:
34 update-rc.d ${INITSCRIPT}.first  start 1  S . >/dev/null
35 update-rc.d ${INITSCRIPT}.middle start 29 2 . >/dev/null
36 update-rc.d ${INITSCRIPT}.last   start 99 2 . >/dev/null
37 # end of "create special init scripts which won't be touched any more by grml"
38
39 fi
40
41 #DEBHELPER#
42
43 exit 0