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