Skip to content

Commit

Permalink
Fix Chocobozzz#145 - Using special character & in user password, caus…
Browse files Browse the repository at this point in the history
…es broken config.php
  • Loading branch information
Wutze committed May 2, 2020
1 parent 2d90910 commit e844865
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ cd "$openvpn_admin"
# Replace config.php variables
sed -i "s/\$host = '';/\$host = '$db_host';/" "./include/config.php"
sed -i "s/\$user = '';/\$user = '$mysql_user';/" "./include/config.php"
sed -i "s/\$pass = '';/\$pass = '$mysql_user_pass';/" "./include/config.php"
escaped=$(echo -n "$mysql_user_pass" | sed 's#\\#\\\\#g;s#&#\\&#g')
sed -i "s/\$pass = '';/\$pass = '${escaped}';/" "./include/config.php"

# Replace in the client configurations with the ip of the server and openvpn protocol
for file in $(find ../ -name client.ovpn); do
Expand Down

0 comments on commit e844865

Please sign in to comment.