File: authmigrate.in

package info (click to toggle)
courier-authlib 0.69.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,340 kB
  • sloc: ansic: 15,551; sh: 4,627; cpp: 4,172; makefile: 774; perl: 747
file content (85 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! @SHELL@
#
# Migrate script from pre courier-authlib versions of Courier.
#
#
# Copyright 2004-2009 Double Precision, Inc.  See COPYING for
# distribution information.

prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@

chk_file() {

file="$1"
dstfile="$2"
rc=0

for dir in	/etc/courier \
		/etc/courier/authlib \
		/etc/courier-imap \
		/usr/lib/courier/etc \
		/usr/lib/courier-imap/etc \
		/usr/local/etc \
		/usr/local/etc/courier \
		/usr/local/courier/etc \
		/usr/local/lib/courier/etc \
		/usr/local/lib/courier-imap/etc \
		/usr/local/share/sqwebmail \
		/usr/local/etc/courier-imap
do
	if test -f "$dstfile"
	then
		if test -r "$dir/$file"
		then
			echo "Obsolete: $dir/$file""(.dist)?"
		fi
		continue
	fi

	if test -d "$dstfile"
	then	
		if test -r "$dir/$file"
		then
			echo "Obsolete: $dir/$file""(.dist)?"
		fi
		continue
	fi

	if test ! -r $dir/$file
	then
		continue
	fi

	if test -f "$dir/$file"
	then
		if test "$file" = "userdb"
		then
			:
		else
			if test "`sed -n 1p $dir/$file | sed -n '/^##VERSION/p'`" = ""
			then
				continue
			fi
		fi
	fi

	echo "$dir/$file => $dstfile"
	cp -pr "$dir/$file"  "$dstfile"
	rc=1
done
return $rc
}

chk_file authdaemonrc ${DESTDIR}@authdaemonrc@
chk_file authmysqlrc ${DESTDIR}@authmysqlrc@
chk_file authpgsqlrc ${DESTDIR}@authpgsqlrc@
chk_file authldaprc ${DESTDIR}@authldaprc@
chk_file userdb ${DESTDIR}@userdb@

if test "$?" = "1"
then
	echo "makeuserdb..."
	$sbindir/makeuserdb
fi