File: finish-install

package info (click to toggle)
cdrom-detect 1.114
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,156 kB
  • sloc: sh: 244; makefile: 11
file content (25 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download | duplicates (9)
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 -e

. /usr/share/debconf/confmodule

log() {
	logger -t cdrom-detect "$@"
}

# Cannot just tell eject to eject /cdrom as it is not compatible
# with busybox umount. Instead, unmount the cdrom first, and then
# eject the device.
CDDEV=$(mount | grep "on /cdrom" | cut -d ' ' -f 1)
if [ -n "$CDDEV" ]; then
	log "Unmounting and ejecting '$CDDEV'"
	umount /cdrom || true

	db_get cdrom-detect/eject
	if [ "$RET" = false ]; then
		log "Not ejecting CD, per debconf setting."
	else
		eject $CDDEV || true
	fi
else
	log "Not ejecting CD, as nothing is mounted."
fi