CasaOS icon indicating copy to clipboard operation
CasaOS copied to clipboard

[Bug] setup-gateway.sh failed.

Open wushilin opened this issue 3 years ago • 1 comments
trafficstars

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior on Ubuntu 22:

  1. curl -fsSL https://get.casaos.io | bash

Expected behavior Installation successful

Actual Behavior [ INFO ] Running /tmp/casaos-installer/tmp.bVxXF2APij/build/scripts/setup/script.d/01-setup-gateway.sh... 🟩 Running setup-gateway.sh... /tmp/casaos-installer/tmp.bVxXF2APij/build/scripts/setup/service.d/gateway/ubuntu/jammy/setup-gateway.sh (line 14): Missing end to balance this if statement if [ ! -f "${CONF_FILE}" ]; then
^ warning: Error while reading file /tmp/casaos-installer/tmp.bVxXF2APij/build/scripts/setup/service.d/gateway/ubuntu/jammy/setup-gateway.sh

🟥 setup-gateway.sh failed.

Root cause:

#cat /tmp/casaos-installer/tmp.bVxXF2APij/build/scripts/setup/service.d/gateway/ubuntu/jammy/setup-gateway.sh ... if [ ! -f "${CONF_FILE}" ]; then \ <= This is extra echo "Initializing config file..." cp -v "${CONF_FILE_SAMPLE}" "${CONF_FILE}"; \ <= This is extra fi ...

wushilin avatar Sep 19 '22 15:09 wushilin

Actually not the root cause.

The root cause is that I am not using bash. Your script referred $SHELL but that is not correct.

The root cause is that you assume everyone uses bash as shell. I have to chsh to bash to run it.

Can you replace $SHELL with bash path? Because not everyone is using bash...

wushilin avatar Sep 19 '22 15:09 wushilin