File: postinst

package info (click to toggle)
mt-daapd 0.9~r1696.dfsg-6lenny3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,960 kB
  • ctags: 3,220
  • sloc: ansic: 25,552; sh: 9,055; perl: 454; xml: 339; makefile: 225
file content (26 lines) | stat: -rw-r--r-- 737 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
#!/bin/sh

set -e

# First time install
if ! getent passwd mt-daapd > /dev/null 2>&1; then
    adduser --quiet --system --no-create-home --home /var/cache/mt-daapd --shell /bin/true mt-daapd
fi

# Upgrade...
if [ "$1" = "upgrade" ]; then
    if dpkg --compare-versions "$2" le "0.2.4+r1376-2"; then
	# Fix permissions on mt-daapd.conf, bad override from before..
	dpkg-statoverride --remove /etc/mt-daapd.conf
    fi
fi

if ! dpkg-statoverride --list /var/cache/mt-daapd > /dev/null 2>&1; then
    dpkg-statoverride --update --add mt-daapd root 0775 /var/cache/mt-daapd
fi

if ! dpkg-statoverride --list /etc/mt-daapd.conf > /dev/null 2>&1; then
    dpkg-statoverride --update --add mt-daapd root 0600 /etc/mt-daapd.conf
fi

#DEBHELPER#