File: getty-run.postrm

package info (click to toggle)
runit 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,248 kB
  • sloc: ansic: 5,590; sh: 3,690; makefile: 385
file content (29 lines) | stat: -rwxr-xr-x 1,005 bytes parent folder | download
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
26
27
28
29
#!/bin/sh
set -e

if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = "purge" ] ; then
	#rm instances (the meta/pkg file can still be used)
	if  [ -z "$DPKG_ROOT" ] && [ "$(uname -s)" = 'GNU' ] ; then
          #rm the console instance we created in portinst on Hurd
          for i in 1 2 3 4 5 6 7 ; do
            #[ -r /etc/sv/getty@console/.meta/pkg ] || break
            #pkgname=$(cat /etc/sv/getty@console/.meta/pkg)
            #[ 'getty-run' = "$pkgname" ] || break
            if [ ! -e /etc/sv/getty@console/supervise/lock ]; then
              rm -rf  /etc/sv/getty@console ; break ;
            elif timeout 1 flock /etc/sv/getty@console/supervise/lock true ; then
              rm -rf /etc/sv/getty@console
              break
            else
              echo "waiting for runsv to exit.."
            fi
          done
	fi
	#now rm the template
	echo "purging the getty@default template.."
	if rm -rf /usr/share/runit/sv.now/getty@default ; then
          echo ".. done"
        fi
fi

#DEBHELPER#