File: ucf.preinst

package info (click to toggle)
ucf 3.0052
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,204 kB
  • sloc: sh: 1,384; perl: 397; makefile: 31
file content (28 lines) | stat: -rwxr-xr-x 545 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
27
28
#! /bin/sh

set -e

statedir='/var/lib/ucf';

case "$1" in
  install)
      echo >&2 "Moving old data out of the way"
      for i in $(seq 6 -1 0); do
	  if [ -e "${statedir}/hashfile.${i}" ]; then
	      cp -f "${statedir}/hashfile.${i}" \
		  "${statedir}/hashfile.$(($i+1))"
	  fi
      done
      if [ -e "$statedir/hashfile" ]; then
	  cp -f "$statedir/hashfile"  "$statedir/hashfile.0"
      fi
    ;;
  upgrade) ;;
  abort-upgrade) ;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
     exit 0;;
esac

#DEBHELPER#

exit 0