Skip to content
Snippets Groups Projects
Commit 5b6702c2 authored by Bob Mottram's avatar Bob Mottram
Browse files

Return values

parent 9d937316
No related branches found
No related tags found
No related merge requests found
......@@ -203,12 +203,18 @@ function remove_user_etherpad {
function add_user_etherpad {
new_username="$1"
new_user_password="$2"
${PROJECT_NAME}-pass -u $new_username -a etherpad -p "$new_user_password"
read_config_param ETHERPAD_DOMAIN_NAME
if ! grep -q "\"$new_username\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
${PROJECT_NAME}-pass -u $new_username -a etherpad -p "$new_user_password"
sed -i "/\"users\": {/a \"$new_username\": { \"password\": \"$new_user_password\", \"is_admin\": false }," /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
systemctl restart etherpad
if grep -q "\"$new_username\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
systemctl restart etherpad
else
echo '1'
return
fi
fi
echo '0'
}
function install_interactive_etherpad {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment