]> git.madduck.net Git - code/vinst.git/blob - preseed/stretch/commands/late_commands.d/post_boot_cleanup

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

remove /itworked from post-boot-cleanup
[code/vinst.git] / preseed / stretch / commands / late_commands.d / post_boot_cleanup
1 #!/bin/sh
2
3 if [ -f /etc/inittab ]; then
4
5   SCRIPT=/etc/init.d/post_boot_cleanup
6   SYMLINK=/etc/rcS.d/S99post_boot_cleanup
7
8   cat >> $SCRIPT <<-_eof
9   #!/bin/sh
10   sed -i -e '/getty.*tty[12]/s/^#//' /etc/inittab
11   telinit q
12   update-rc.d ${SCRIPT##*/} remove
13   rm $SCRIPT
14         _eof
15
16   chmod 755 $SCRIPT
17   update-rc.d ${SCRIPT##*/} start S 99 .
18
19 else
20
21   SCRIPT=/usr/local/sbin/post_boot_cleanup
22   UNIT=/etc/systemd/system/multi-user.target.wants/post_boot_cleanup.service
23
24   cat >> $SCRIPT <<-_eof
25         #!/bin/sh
26         echo "Running post-install cleanup jobs..." >&2
27         rm $SCRIPT $UNIT
28         _eof
29   chmod 755 $SCRIPT
30
31   cat >> $UNIT <<-_eof
32         [Unit]
33         Description=post-install cleanups
34         ConditionFileIsExecutable=$SCRIPT
35         After=multi-user.target
36
37         [Service]
38         Type=idle
39         ExecStart=$SCRIPT
40         TimeoutSec=0
41         RemainAfterExit=yes
42         SysVStartPriority=99
43         _eof
44
45 fi