techahold / rustdeskinstall

Easy install Script for Rustdesk
MIT License
371 stars 113 forks source link

Running it with SH instead of BASH breaks it #75

Closed lucasmontec closed 4 months ago

lucasmontec commented 4 months ago

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
dinger1986 commented 4 months ago

Good idea.

Do you want to PR a change?

lucasmontec commented 4 months ago

I'm a bit on a rush but I can send something later.

On Tue, Jun 4, 2024 at 4:58 PM dinger1986 @.***> wrote:

Good idea.

Do you want to PR a change?

— Reply to this email directly, view it on GitHub https://github.com/techahold/rustdeskinstall/issues/75#issuecomment-2148316897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKRX7MFLTTA7PZVHKHP2R3ZFYL6FAVCNFSM6AAAAABIZCUVYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYGMYTMOBZG4 . You are receiving this because you authored the thread.Message ID: @.***>

--

Lucas Montenegro Carvalhaes Rogue Developer - Sawce http://www.sawcegames.com

May the sawce be with you

dinger1986 commented 4 months ago

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