File: gpsd.postinst

package info (click to toggle)
gpsd 2.33-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 2,904 kB
  • ctags: 1,861
  • sloc: ansic: 14,508; sh: 9,172; xml: 2,657; python: 1,446; makefile: 334; cpp: 120; perl: 22
file content (39 lines) | stat: -rw-r--r-- 825 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# postinst script for gpsd

set -e

. /usr/share/debconf/confmodule

if [ "$1" = "configure" ] ; then

	# udev: install symlink to gpsd.rules
	#   udev handling got introduced in 2.32-2 - only create symlink once
	#   on new package install or when upgrading from an older version
	if dpkg --compare-versions "$2" lt "2.32-2" ; then
		ln -sf ../gpsd.rules /etc/udev/rules.d/025_gpsd.rules
	fi

	# generate /etc/default/gpsd
	db_get gpsd/device
	DEVICES=$RET
	db_get gpsd/start_daemon
	START=$RET
	db_get gpsd/daemon_options
	OPTS=$RET
	cat <<EOF > /etc/default/gpsd
# Default settings for gpsd. This file is sourced from
# /etc/init.d/gpsd.
START_DAEMON="$START"
DAEMON_OPTS="$OPTS"
DEVICES="$DEVICES"
EOF

fi
	
#DEBHELPER#

# tell debconf we are done. otherwise, it hangs waiting for the daemon.
db_stop;

exit 0