add configuration option to control recurring_flag behavior, RT#3843
[freeside.git] / FS / bin / freeside-addoutsource
1 #!/bin/sh
2
3 domain=$1
4
5 FREESIDE_CONF=%%%FREESIDE_CONF%%%
6 FREESIDE_CACHE=%%%FREESIDE_CACHE%%%
7 FREESIDE_EXPORT=%%%FREESIDE_EXPORT%%%
8
9 #without this, [a-z]* matches CVS/, the copy doesn't return a sucessful error
10 # status, and the rest of the commands aren't run
11 export LANG=C
12
13 createdb $domain && \
14 \
15 mkdir $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
16 \
17 chown freeside $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
18 \
19 cp /home/ivan/freeside/conf/[a-z]* $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
20 \
21 touch $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
22 \
23 chown freeside $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
24 \
25 chmod 600 $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
26 \
27 echo -e "DBI:Pg:dbname=$domain\nfreeside\n" >$FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
28 \
29 mkdir $FREESIDE_CACHE/counters.DBI:Pg:dbname=$domain && \
30 mkdir $FREESIDE_CACHE/cache.DBI:Pg:dbname=$domain && \
31 mkdir $FREESIDE_EXPORT/export.DBI:Pg:dbname=$domain
32