Bash Script that only runs in terminal
Add the .command extension

To have a bash script open and execute in macOS's Terminal.app, add the suffix .command to the filename.

If you have a bash script called myscript.sh, rename it to myscript.command. Once renamed, when the file is double-clicked or opened from macOS's Finder the Terminal.app will open and execute the file.

Code Signing

The Unidentified Developer warning appears because the script is not code signed. It is a reasonable warning from macOS, as a script could do harm.

If you are distributing the script through a web site, you need to code sign the payload or contents. How to best achieve this depends on your users' environment.

See making an executable bash file run when clicked for reasonable approaches such as an AppleScript wrapper or platypus. 

AppleScript Wrapper

You can embed a shell script within an AppleScript. Exported AppleScripts can be made executable and code signed:

 Applications &gt; Utilities &gt; Script Editor.app


Use the do shell script command and File > Export with code signing enabled.