File: afbackup-client.postinst

package info (click to toggle)
afbackup 3.3.8.1beta2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,128 kB
  • ctags: 3,370
  • sloc: ansic: 46,932; sh: 4,654; tcl: 4,199; makefile: 536; csh: 416; perl: 133; sed: 93
file content (45 lines) | stat: -rw-r--r-- 789 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
#!/bin/sh -e

fix_cruft ()
{
   DOC=/usr/share/doc/afbackup-client
   test -d $DOC && rm -rf $DOC && ln -s afbackup-common $DOC
   case "$1" in
      2.6*)
	 echo "Moving state files to new location!"
	 (
	    cd /var/log/afbackup/
	    mv part num oldmark newmark oldmark.org backup_log.* \
	       /var/lib/afbackup > /dev/null 2>&1
	 )
      ;;
   esac    
}

cryptkey ()
{
   FILE=/etc/afbackup/cryptkey
   if [ -f $FILE ]; then
      FILE=$FILE.dpkg-dist
   fi
   dd if=/dev/urandom of=$FILE bs=21 count=1 2> /dev/null
   chmod 600 $FILE
}

case "$1" in
    configure)
        fix_cruft $2
        cryptkey
    ;;

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

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


#DEBHELPER#