Adding owncloud users

This commit is contained in:
Bob Mottram 2015-11-10 12:29:43 +00:00
parent 236c65d70a
commit 702f28cf15
1 changed files with 14 additions and 2 deletions

View File

@ -205,7 +205,7 @@ if grep -q "Blog domain" $COMPLETION_FILE; then
fi
if grep -q "install_sip" $COMPLETION_FILE; then
SIP_EXTENSION=$(freedombone-sipfreeext)
SIP_EXTENSION=$(freedombone-sipfreeext)
freedombone-addsipuser -u $MY_USERNAME -e $SIP_EXTENSION -p "$NEW_USER_PASSWORD"
if [ ! "$?" = "0" ]; then
echo 'SIP user could not be added. Ensure that extension numbers are in order and do no exceed 299'
@ -214,10 +214,22 @@ if grep -q "install_sip" $COMPLETION_FILE; then
fi
fi
if grep -q "install_owncloud" $COMPLETION_FILE; then
export OC_PASS="$NEW_USER_PASSWORD"
occ user:add --password-from-env --display-name="$MY_USERNAME" --group="users" $MY_USERNAME
if [ ! "$?" = "0" ]; then
echo 'Owncloud user could not be added'
freedombone-rmsipuser $MY_USERNAME
userdel -r $MY_USERNAME
exit 11
fi
export OC_PASS=""
fi
clear
echo "New user $MY_USERNAME was created"
if [ $SIP_EXTENSION ]; then
echo "Their SIP phone extension is $SIP_EXTENSION"
echo "Their SIP phone extension is $SIP_EXTENSION"
fi
echo "Their login password is $NEW_USER_PASSWORD"
echo ''