shellcheck
shfmt
Use bash functionality rather than external binaries. Alsö, if $SUDO_ASKPASS is set then pass -A to sudo.