File: afbackup-client.postinst

package info (click to toggle)
afbackup 3.1beta1-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,500 kB
  • ctags: 1,685
  • sloc: ansic: 22,406; csh: 3,597; tcl: 964; sh: 403; makefile: 200
file content (38 lines) | stat: -rw-r--r-- 1,231 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
#!/bin/sh -e

case "$1" in
    configure)
	case "$2" in
	    2.6*)
	        echo "Moving state files to new location!"
                mv /var/log/afbackup/part /var/lib/afbackup > /dev/null 2>&1 || true
                mv /var/log/afbackup/num /var/lib/afbackup > /dev/null 2>&1 || true
                mv /var/log/afbackup/oldmark /var/lib/afbackup > /dev/null 2>&1 || true
                mv /var/log/afbackup/newmark /var/lib/afbackup > /dev/null 2>&1 || true
                mv /var/log/afbackup/oldmark.org /var/lib/afbackup > /dev/null 2>&1 || true
                mv /var/log/afbackup/backup_log.* /var/lib/afbackup > /dev/null 2>&1 || true
	     ;;
        esac    
        # continue below
    ;;

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

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

if [ ! -f /etc/afbackup/cryptkey ]; then
    echo "Please supply a encryption key for client/server authentification"
    echo "It should be at least 5 characters and must be the same everywhere in your network."
    read key
    touch /etc/afbackup/cryptkey
    chmod 600 /etc/afbackup/cryptkey
    echo $key >> /etc/afbackup/cryptkey
fi

#DEBHELPER#