File: postinst

package info (click to toggle)
xbomb 2.2a-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 240 kB
  • sloc: ansic: 1,440; makefile: 30; sh: 17
file content (29 lines) | stat: -rw-r--r-- 681 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
#!/bin/sh
set -e

#DEBHELPER#

# none of the following checks script arguments because it's all
# harmless and can be done repeatedly without danger.

# create the new high-scores directory if needed
mkdir -p /var/games/xbomb

# clean up any existing files in the old location, /var/lib/games
if [ -d /var/lib/games/xbomb ]; then
    mv /var/lib/games/xbomb/* /var/games/xbomb || true
    rm -rf /var/lib/games/xbomb || true
fi

# Create empty hi-score files if needed

cd /var/games/xbomb/

for i in xbomb6.hi xbomb4.hi xbomb3.hi; do
    if [ ! -e $i ]; then
	touch $i
	chown root:games $i
    fi
    # Set permissions (fixes permissions of pre 2.0-3 files)
    chmod 664 $i
done