File: postinst

package info (click to toggle)
nighthawk 2.3%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,404 kB
  • ctags: 18,605
  • sloc: fortran: 17,597; cpp: 5,779; ansic: 2,671; sh: 1,968; makefile: 119
file content (26 lines) | stat: -rw-r--r-- 525 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
#!/bin/sh
set -e

# The old nighthawk 1.0 packages used this non-FHS location
OLD_SCORES=/var/lib/games/nighthawk.scores
SCORES=/var/games/nighthawk.scores

if [ ! -e ${SCORES%/*} ]; then
  mkdir ${SCORES%/*}
fi

# Move the old scores to the new location.
# Don't leave an empty and useless directory behind.
if [ -e $OLD_SCORES ]; then
  mv $OLD_SCORES $SCORES
  rmdir --ignore-fail-on-non-empty ${OLD_SCORES%/*}
fi

if [ ! -e $SCORES ]; then
  touch $SCORES
  chown root:games $SCORES
  chmod 0664 $SCORES
fi

#DEBHELPER#