Move AFS vmail tokens to preauthuserdbcommon.c.
[hcoop/debian/courier-authlib.git] / authmigrate.in
CommitLineData
d9898ee8 1#! @SHELL@
2#
3# Migrate script from pre courier-authlib versions of Courier.
4#
5# $Id: authmigrate.in,v 1.2 2005/02/13 11:26:19 mrsam Exp $
6#
7# Copyright 2004 Double Precision, Inc. See COPYING for
8# distribution information.
9
10prefix=@prefix@
11exec_prefix=@exec_prefix@
12sbindir=@sbindir@
13
14chk_file() {
15
16file="$1"
17dstfile="$2"
18rc=0
19
20for dir in /etc/courier \
21 /usr/lib/courier/etc \
22 /usr/lib/courier-imap/etc \
23 /usr/local/etc \
24 /usr/local/etc/courier \
25 /usr/local/courier/etc \
26 /usr/local/lib/courier/etc \
27 /usr/local/lib/courier-imap/etc \
28 /usr/local/share/sqwebmail \
29 /usr/local/etc/courier-imap
30do
31 if test -f "$dstfile"
32 then
33 if test -r "$dir/$file"
34 then
35 echo "Obsolete: $dir/$file""(.dist)?"
36 fi
37 continue
38 fi
39
40 if test -d "$dstfile"
41 then
42 if test -r "$dir/$file"
43 then
44 echo "Obsolete: $dir/$file""(.dist)?"
45 fi
46 continue
47 fi
48
49 if test ! -r $dir/$file
50 then
51 continue
52 fi
53
54 if test -f "$dir/$file"
55 then
56 if test "$file" = "userdb"
57 then
58 :
59 else
60 if test "`sed -n 1p $dir/$file | sed -n '/^##VERSION/p'`" = ""
61 then
62 continue
63 fi
64 fi
65 fi
66
67 echo "$dir/$file => $dstfile"
68 cp -pr "$dir/$file" "$dstfile"
69 rc=1
70done
71return $rc
72}
73
74chk_file authdaemonrc @authdaemonrc@
75chk_file authmysqlrc @authmysqlrc@
76chk_file authpgsqlrc @authpgsqlrc@
77chk_file authldaprc @authldaprc@
78chk_file userdb @userdb@
79
80if test "$?" = "1"
81then
82 echo "makeuserdb..."
83 $sbindir/makeuserdb
84fi