techahold/rustdeskinstall

Running it with SH instead of BASH breaks it

lucasmontec opened this issue · 3 comments

Since the syntax expects bash, you could add a check to prevent users trying to run with sh.
I got an error with sh because comparisons for sh are done with = not ==, and a bad substitution error here UPSTREAM_ID=${ID_LIKE,,}.

This seems to be syntax explicitly for bash.
I have added this to mine so I remember to run it correctly:

# Check if the script is being run with bash
if [ -z "$BASH_VERSION" ]; then
  echo "Error: This script must be run with bash, not sh."
  exit 1
fi

Good idea.

Do you want to PR a change?

Yea of course. I'll close this and wait for you to do the PR 👍