File: postinst

package info (click to toggle)
gweled 0.9.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,592 kB
  • ctags: 628
  • sloc: ansic: 4,170; sh: 2,082; makefile: 100
file content (50 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download | duplicates (4)
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
50
#!/bin/sh
# postinst script for gweled
#

set -e

case "$1" in
    configure)
	if [ -f /var/games/gweled.easy.scores ]; then
	    if [ ! -f /var/games/gweled.Normal.scores ]; then
		mv /var/games/gweled.easy.scores /var/games/gweled.Normal.scores;
	    else
		rm /var/games/gweled.easy.scores;
	    fi
	fi
	if [ -f /var/games/gweled.timed.scores ]; then
	    if [ ! -f /var/games/gweled.Timed.scores ]; then
		mv /var/games/gweled.timed.scores /var/games/gweled.Timed.scores;
	    else
		rm /var/games/gweled.timed.scores;
	    fi
	fi

	if [ -f /var/games/gweled.hard.scores ]; then
	    rm /var/games/gweled.hard.scores;
	fi

	for scorefile in Normal Timed; do
	    [ ! -f /var/games/gweled.${scorefile}.scores ] && \
		touch /var/games/gweled.${scorefile}.scores;
	    chown root:games /var/games/gweled.${scorefile}.scores;
	    chmod 664 /var/games/gweled.${scorefile}.scores;
	done

	dpkg-statoverride --remove /usr/games/gweled >/dev/null 2>&1 || true
	dpkg-statoverride --update --add root games 02755 /usr/games/gweled
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0