summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-addoutsource
blob: 9cb12195a73da4b4042a33f3bf1eafa9f1afe7d1 (plain)
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
#!/bin/sh

domain=$1

FREESIDE_CONF=%%%FREESIDE_CONF%%%
FREESIDE_CACHE=%%%FREESIDE_CACHE%%%
FREESIDE_EXPORT=%%%FREESIDE_EXPORT%%%

#without this, [a-z]* matches CVS/, the copy doesn't return a sucessful error
# status, and the rest of the commands aren't run
export LANG=C

createdb $domain && \
\
mkdir $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
\
chown freeside $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
\
cp /home/ivan/freeside/conf/[a-z]* $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain && \
\
touch $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
\
chown freeside $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
\
chmod 600 $FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
\
echo -e "DBI:Pg:dbname=$domain\nfreeside\n" >$FREESIDE_CONF/conf.DBI:Pg:dbname=$domain/secrets && \
\
mkdir $FREESIDE_CACHE/counters.DBI:Pg:dbname=$domain && \
mkdir $FREESIDE_CACHE/cache.DBI:Pg:dbname=$domain && \
mkdir $FREESIDE_EXPORT/export.DBI:Pg:dbname=$domain