Refactor update.sh
Add shellcheck