View | Details | Raw Unified | Return to bug 57517 | Differences between
and this patch

Collapse All | Expand All

(-)210.backup-aliases (-19 / +25 lines)
Lines 13-43 Link Here
13
13
14
case "$daily_backup_aliases_enable" in
14
case "$daily_backup_aliases_enable" in
15
    [Yy][Ee][Ss])
15
    [Yy][Ee][Ss])
16
	if [ ! -f /etc/mail/aliases ]
16
	if [ $daily_backup_aliases_file = "" ]
17
	then
17
	then
18
	    echo '$daily_backup_aliases_enable is enabled but' \
18
	    echo '$daily_backup_aliases_enable is enabled but' \
19
		"/etc/mail/aliases doesn't exist"
19
		'$daily_backup_aliases_file is not defined'
20
	    rc=2
20
	    rc=2
21
	else
21
	else
22
	    bak=/var/backups
22
	    if [ ! -f $daily_backup_aliases_file ]
23
	    rc=0
23
	    then
24
		echo '$daily_backup_aliases_enable is enabled but' \
25
		"$daily_backup_aliases_file doesn't exist"
26
		rc=2
27
	    else
28
		bak=/var/backups
29
		rc=0
24
30
25
	    echo ""
31
		echo ""
26
	    echo "Backing up mail aliases:"
32
		echo "Backing up mail aliases:"
27
33
28
	    if [ ! -f $bak/aliases.bak ]
34
		if [ ! -f $bak/aliases.bak ]
29
	    then
35
		then
30
		echo "no $bak/aliases.bak"
36
		    echo "no $bak/aliases.bak"
31
		cp -p /etc/mail/aliases $bak/aliases.bak || rc=3
37
		    cp -p $daily_backup_aliases_file $bak/aliases.bak || rc=3
32
	    fi
38
		fi
33
39
34
	    if ! cmp -s $bak/aliases.bak /etc/mail/aliases
40
		if ! cmp -s $bak/aliases.bak $daily_backup_aliases_file
35
	    then
41
		then
36
		[ $rc -lt 1 ] && rc=1
42
		    [ $rc -lt 1 ] && rc=1
37
		echo "$host aliases diffs:"
43
		    echo "$host aliases diffs:"
38
		diff -u $bak/aliases.bak /etc/mail/aliases
44
		    diff -u $bak/aliases.bak $daily_backup_aliases_file
39
		mv $bak/aliases.bak $bak/aliases.bak2
45
		    mv $bak/aliases.bak $bak/aliases.bak2
40
		cp -p /etc/mail/aliases $bak/aliases.bak || rc=3
46
		    cp -p $daily_backup_aliases_file $bak/aliases.bak || rc=3
47
		fi
41
	    fi
48
	    fi
42
	fi;;
49
	fi;;
43
------------------------- cut here ---------------------------------------

Return to bug 57517