System for in-place upgrade

All the shell scripts pass http://www.shellcheck.net/