Escape slashes from smtp_password
authorMatt Palmer <mpalmer@hezmatt.org>
Sun, 24 Jul 2016 23:25:17 +0000 (09:25 +1000)
committerMatt Palmer <mpalmer@hezmatt.org>
Tue, 26 Jul 2016 00:15:08 +0000 (10:15 +1000)
Makes sed a whole lot happier about life.

discourse-setup

index 67d84d49f0331008682b9d0db7a2dff84c0b6cd9..94a90b5d1e0ea96cdbc0d45b144be427826d1c60 100755 (executable)
@@ -321,7 +321,7 @@ ask_user_for_config() {
     update_ok="n"
   fi
 
-  sed -i -e "s/^  #DISCOURSE_SMTP_PASSWORD:.*/  DISCOURSE_SMTP_PASSWORD: \"$smtp_password\"/w $changelog" $config_file
+  sed -i -e "s/^  #DISCOURSE_SMTP_PASSWORD:.*/  DISCOURSE_SMTP_PASSWORD: \"${smtp_password/\//\\/}\"/w $changelog" $config_file
   if [ -s $changelog ]
   then
       rm $changelog