Update changelog for release (0.8.27)
[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 DATE=$(date)
10
11 # bootup
12 INITSCRIPT=bootlocal
13 INITNAME=/etc/init.d/${INITSCRIPT}
14
15 for initscript in ${INITNAME}.first ${INITNAME}.middle ${INITNAME}.last ; do
16   if ! [ -r "$initscript" ] ; then
17      einfo "Creating ${initscript}"
18   cat >$initscript <<EOT
19 #!/bin/sh
20 # Filename:      $initscript
21 # Purpose:       script which allows manual configuration of bootup process
22 # Latest change: $DATE
23 ################################################################################
24 # Notice: you can modify this file as you like as long as you do not rename it!
25 # grml won't touch this file, even not on upgrades. It will be created only
26 # once - when the file isn't present at all.
27 ################################################################################
28
29 ## END OF FILE #################################################################
30 EOT
31   chmod 755 $initscript; eend $?
32   fi
33 done
34
35 # register initscripts via update-rc.d:
36 update-rc.d ${INITSCRIPT}.first  start 1  S . >/dev/null
37 update-rc.d ${INITSCRIPT}.middle start 29 2 . >/dev/null
38 update-rc.d ${INITSCRIPT}.last   start 99 2 . >/dev/null
39
40 # shutdown
41 INITSCRIPT=haltlocal
42 INITNAME=/etc/init.d/${INITSCRIPT}
43
44 for initscript in ${INITNAME}.first ${INITNAME}.middle ${INITNAME}.last ; do
45   if ! [ -r "$initscript" ] ; then
46      einfo "Creating ${initscript}"
47   cat >$initscript <<EOT
48 #!/bin/sh
49 # Filename:      $initscript
50 # Purpose:       script which allows manual configuration of shutdown process
51 # Latest change: $DATE
52 ################################################################################
53 # Notice: you can modify this file as you like as long as you do not rename it!
54 # grml won't touch this file, even not on upgrades. It will be created only
55 # once - when the file isn't present at all.
56 ################################################################################
57
58 ## END OF FILE #################################################################
59 EOT
60   chmod 755 $initscript; eend $?
61   fi
62 done
63
64 # register initscripts via update-rc.d:
65 update-rc.d ${INITSCRIPT}.first  stop 1  0 1 6 . >/dev/null
66 update-rc.d ${INITSCRIPT}.middle stop 29 0 1 6 . >/dev/null
67 update-rc.d ${INITSCRIPT}.last   stop 99 0 1 6 . >/dev/null
68
69 # end of "create special init scripts which won't be touched any more by grml"
70 fi
71
72 #DEBHELPER#
73
74 exit 0