Bash upgrade scripts

Estimated reading time of this article: 1 minute

The static site generator has a high release frequency. The password manager KeePass has regularly new versions. Versions must be kept up to date.

How to automatically upgrade Hugo or KeePass?

I've written bash scripts which check the version and upgrade the local installation of Hugo or KeePass.

By default, the upgrade is interactive: each step must be confirmed. If the option -a is used the upgrade is performed automatically.

The existing installation is renamed to .old.

The copies the configuration and the plugins from the old installation to the new one.

The version is stored in _VERSION.txt and _VERSION_X.Y.txt. The first file is useful for machines and the second one gives a quick overview for humans.