Generally, you can post it within a Markdown code block. You can specify it as bash code like this (close is with three more ` marks:
I prefer folks not link to other sites, as we have no control over them, and they could disappear at any time (whereas we’ve migrated the content of this forum through five different forum apps spanning 15 years, so nothing ever posted here has disappeared).
This forum does allow uploads of some file types, but I don’t see any reason a shell script (of reasonable length) shouldn’t be posted in an easily visible form. People probably want to customize it, or at least read over it carefully before running it, anyway.