summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-addoutsourceuser
blob: cbe792acc9b8b93e0c13f4db8eb6c435b52e30a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

username=$1
domain=$2
password=$3
realdomain=$4
FREESIDE_CONF=%%%FREESIDE_CONF%%%

freeside-adduser -s conf.DBI:Pg:dbname=$domain/secrets \
                 -n \
                 $username #2>/dev/null

[ -e $FREESIDE_CONF/dbdef.DBI:Pg:dbname=$domain ] \
 || ( freeside-setup -d $realdomain -u $username )

freeside-adduser -g 1 $username

htpasswd -b $FREESIDE_CONF/htpasswd $username $password