File: prebaseconfig

package info (click to toggle)
cdrom-detect 1.05sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 472 kB
  • ctags: 6
  • sloc: sh: 156; makefile: 39
file content (19 lines) | stat: -rwxr-xr-x 493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/sh -e

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

if test -x /target/usr/bin/eject ; then
	# 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
		/target/usr/bin/eject $CDDEV || true
	else
		log "Not ejecting CD, as nothing is mounted."
	fi
fi