From 1b3691742e13ae76a23333b981be3c878bed1678 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Sat, 19 Nov 2016 21:50:43 +0000
Subject: [PATCH] Slashes

---
 src/freedombone-app-etherpad | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/freedombone-app-etherpad b/src/freedombone-app-etherpad
index 3383deae..9d93b5b2 100755
--- a/src/freedombone-app-etherpad
+++ b/src/freedombone-app-etherpad
@@ -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
 }