I know that bash (if installed on OpenWrt) sets $SHELL. How can I find what the default shell is if it's ash? Should I assume it's ash if the $SHELL is empty/not set?
I'm going to source some user-configured files and I want to run the syntax check before sourcing them, but I want to make sure I'm running a syntax check with the correct shell.
The default OpenWrt shell is BusyBox ash.
Neither the login shell from /etc/passwd nor the current shell from $SHELL are required to be the default.
Probably you shouldn't use sourcing if the code is not portable/compatible.
Verify the specific shell binary exists and invoke it either explicitly or via the shebang.