Slashes
This commit is contained in:
parent
7d44aed03d
commit
1b3691742e
|
@ -60,12 +60,12 @@ function change_password_etherpad {
|
|||
read_config_param ETHERPAD_DOMAIN_NAME
|
||||
|
||||
${PROJECT_NAME}-pass -u $change_username -a etherpad -p "$new_user_password"
|
||||
if grep "\"${change_username}\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
|
||||
user_line=$(cat /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json | grep "\"${change_username}\": {")
|
||||
if grep "\"\${change_username}\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
|
||||
user_line=$(cat /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json | grep "\"\${change_username}\": {")
|
||||
if [[ "$user_line" == *"\"is_admin\": true"* ]]; then
|
||||
sed -i "s|\"${change_username}\": {.*|\"${change_username}\": { \"password\": \"${new_user_password}\", \"is_admin\": true }," /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
|
||||
sed -i "s|\"\${change_username}\": {.*|\"\${change_username}\": { \"password\": \"\${new_user_password}\", \"is_admin\": true }" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
|
||||
else
|
||||
sed -i "s|\"${change_username}\": {.*|\"${change_username}\": { \"password\": \"${new_user_password}\", \"is_admin\": false }" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
|
||||
sed -i "s|\"\${change_username}\": {.*|\"\${change_username}\": { \"password\": \"\${new_user_password}\", \"is_admin\": false }," /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue