

4·
1 month agoWelcome to bash! I recommend dropping your code into shellcheck every now and then. Bash is full of footguns, trust me. Instead of screen clear, look up alternate mode for the terminal. It’s super slick.
Separating the script into two pieces will help you troubleshoot in the future, so even though you could join them, there’s really no need for it. At best I’d make them into functions to keep code clean.
If you have any questions, feel free to send them my way, bash is my preferred language and I will gladly guide someone. :)
“Ask not what you can do with the distro, but what the distro has already done for you.”