upgrade.sh: make it user-friendly
- Explain what the script does and ask for confirmation
- Detect the current channel automatically
- Upgrade old channel's packages first
- Do a dry run before the actual upgrade, restore /etc/apk/repositories on failure
- Prompt to reboot when done
- Log script's output to a file
- Upgrade to latest release by default
- Warn the user if doing an unsupported upgrade, or a downgrade, or upgrading to edge
- Show a guiding message on error
- Add usage message (-h)
- Use colors to make script output stand out from apk output
- Check if this is actually running on postmarketOS, and if it's running as root, if user tries to upgrade to same channel, if new channel is valid
- Make the sed for replacing the repositories a bit less error-prone
- No set -x for more readable output
Usually I would have split this up into multiple commits. But since the whole file needed to be rewritten, it didn't seem worth it here.