File: runit-run.postrm

package info (click to toggle)
runit 2.2.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,568 kB
  • sloc: ansic: 6,071; sh: 3,419; makefile: 399
file content (25 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
set -e

if [ -f /etc/inittab ]; then
  awk '
  /^#runit-sysv maintscript -- BEGIN/ { flag = 1 }
                                      { if (flag == 0) print; }
  /^#runit-sysv maintscript -- END/   { flag = 0 }
  ' /etc/inittab > /etc/inittab.tmp
  sed -i '${/^$/d}' /etc/inittab.tmp
  mv /etc/inittab.tmp /etc/inittab
fi

if [ "$1" = "remove" ]; then
	# other inits maintain a compat initctl pipe, so we check that is not
	# systemd, that initctl exists and that sysvinit-core is installed
	if [ ! -d /run/systemd/system ] && [ -e /run/initctl ] ; then
		if [ -e /sbin/telinit ] ; then
			# rescan inittab to pick new entry
			telinit q
		fi
	fi
fi

#DEBHELPER#