chiark / gitweb /
Better diversion arrangements
[modbot-mtm.git] / get-settings
1 #
2
3 paskeys='KEYSUBMIT KEYSTUMP2WEB KEYWEB2STUMP'
4 pas="$paskeys"
5 for k in $pas; do eval "$k=''"; export $k; done
6
7 DIVERTPOSTINGS=''
8
9 . settings
10 export GROUP ABBREV INFOHEADER MODEMAIL GROUPURL REJECTIONSLIST
11 export DIVERTPOSTINGS
12
13 . ../global-settings
14 export ROOTBASEDIR CGIBASEURL DOMAIN SLIMYDOMAIN OURUSER ADMIN
15 export LOGGROUPPREFIX LOGGROUPEMAILPREFIX TESTGROUP
16 export STATICFILESURL STATICFILESDIR CGISCRIPTDIR SPAMFILTERINGADMIN
17
18 BASEDIR=$ROOTBASEDIR/live-$ABBREV
19 export BASEDIR
20
21
22 # derivative settings:
23
24 PUBREJOPT=''
25 if $PUBLISHREJECTIONS; then
26         PUBREJOPT=-P
27 fi
28 export PUBREJOPT
29
30
31 test -f persistent-autosettings || touch persistent-autosettings
32 . persistent-autosettings
33
34 exec 3>persistent-autosettings.new
35 cat >&3 persistent-autosettings
36
37 for k in $pas; do
38         eval "v=\$$k"
39         if [ "x$v" != x ]; then continue; fi
40
41         v="`dd if=/dev/urandom count=6 ibs=1 2> /dev/null \
42                 | uuencode -m - \
43                 | perl -ne 'y/A-Z\+\//a-z01/; print if $.==2;' `"
44         case $v in
45         ????????)       ;;
46         *)              exit 1;;
47         esac
48         case $v in
49         *[^0-9a-z]*)    echo >&2 "unexpected from dd etc.: $v"; exit 1 ;;
50         esac
51         echo >&3 "$k='$v'"
52 done
53
54 mv -f persistent-autosettings.new persistent-autosettings
55
56 exec 3>&-
57 . persistent-autosettings
58