I don't understand what's wrong.
When executing a bash script via wget or curl the script aborts with a syntax error. Although it works if downloaded and executed as a local file bash script.sh.
wget -O- https://domain.com/script.sh | bash
curl https://domain.com/script.sh | bash
Error:
bash: line 114: syntax error near unexpected token "fi"
This is the code:
...
while [[ ! $db_database ]]; do
echo
read -p "MySQL Database: " db_database
done
if [[ -z $db_prefix ]]; then
echo
read -p "MySQL Table Prefix [lc_]: " db_prefix
if [[ ! $db_prefix ]]; then
db_prefix="lc_"
fi # <-- This is the line, 114
fi
if [[ -z $db_collation ]]; then
echo
read -p "MySQL Collation [utf8_swedish_ci]: " db_collation
if [[ ! $db_collation ]]; then
db_collation="utf8_swedish_ci"
fi
fi
...