summarylogtreecommitdiffstats
path: root/pinball.install
blob: e39f87dae8362d3ec3e72f149a704a88bffc7c22 (plain)
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
post_install() {
  touch var/games/pinball/{professor,tux}/highscores
  chown root:games var/games/pinball/{professor,tux}/highscores
  chmod 664 var/games/pinball/{professor,tux}/highscores
}

pre_upgrade() {
  chown root:games var/games/pinball/{professor,tux}
  chmod 775 var/games/pinball/{professor,tux}
  cp var/games/pinball/professor/highscores var/games/pinball/professor/highscores.bak.pre_upgrade
  cp var/games/pinball/tux/highscores var/games/pinball/tux/highscores.bak.pre_upgrade
}

post_upgrade() {
  if [ -e var/games/pinball/professor/highscores.bak.pre_upgrade ]; then
    mv var/games/pinball/professor/highscores.bak.pre_upgrade var/games/pinball/professor/highscores
  fi

  if [ -e var/games/pinball/tux/highscores.bak.pre_upgrade ]; then
    mv var/games/pinball/tux/highscores.bak.pre_upgrade var/games/pinball/tux/highscores
  fi

    touch var/games/pinball/professor/highscores
    chown root:games var/games/pinball/professor/highscores
    chmod 664 var/games/pinball/professor/highscores

    touch var/games/pinball/tux/highscores
    chown root:games var/games/pinball/tux/highscores
    chmod 664 var/games/pinball/tux/highscores
 }