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

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


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

[ -e /usr/local/etc/freeside/dbdef.DBI:Pg:dbname=$domain ] \
 || ( freeside-setup -d $realdomain -u $username )
# 2>/dev/null

freeside-adduser -g 1 $username

htpasswd -b /usr/local/etc/freeside/htpasswd $username $password