File: postinst

package info (click to toggle)
workman 1.3.4-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,164 kB
  • ctags: 1,170
  • sloc: ansic: 14,491; makefile: 142; sh: 44
file content (49 lines) | stat: -rw-r--r-- 1,439 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# Debian standard handling
set -e
case $1 in
abort-*) exit 0;;
esac

# Add the /usr/doc link according to new policy

if [ "$1" = "configure" ]; then
  if [ -d /usr/doc -a ! -e /usr/doc/workman -a -d /usr/share/doc/workman ]; then
    ln -sf ../share/doc/workman /usr/doc/workman
  fi
fi

# The script has to ensure that a link /dev/cdrom to the real
# CD-ROM device exists and that the device belongs to the cdrom
# group and is readable and executable by the group
# Workman should not be run suid root !

if [ -b /dev/cdrom ]
then
	DEVICE=`ls -l /dev/cdrom |sed -e 's/^.* //' -e 's/^\/dev\///'`
	chgrp cdrom /dev/$DEVICE
	chmod g+rwx /dev/$DEVICE
	echo ""
	echo "Workman will use as default device /dev/cdrom pointing to /dev/${DEVICE}."
	echo "The group id of this device has been set to cdrom."
	echo "Please, change the group by hand if you want to use another CDROM device."
	echo ""
else
	DEVICE='/dev/cdrom'
	while [ $DEVICE = '/dev/cdrom' ]
	do
	  DEFAULT='/dev/hdc'
	  echo -n "What is your CDROM device for playing audio CDs ? (${DEFAULT}): "
	  read DEVICE
	  if [ -z $DEVICE ]; then DEVICE=$DEFAULT ; fi
	  if [ $DEVICE = '/dev/cdrom' ]; then echo "Please, use the real physical device name." ; fi
	  DEVICE=`echo $DEVICE | sed -e 's/^\/dev\///' -e 's/^/\/dev\//'`
	done
	ln -sf $DEVICE /dev/cdrom
	chgrp cdrom $DEVICE
	chmod g+rwx $DEVICE
fi

# Update menus
if [ -x /usr/bin/update-menus ]; then update-menus; fi