diff --git a/README.md b/README.md index 574a40d..f1934bc 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ We're planning to release a growing amount of open source software, that is free | Name | Description | License | Current Version | Written in | Supported Distros | File | |------|-------------|---------|-----------------|------------|-------------------|------| -| [Borgmatic Setup Tool](#borgmatic-setup-tool) | If you plan to use borg as backup solution, you should also take a look at [borgmatic](https://torsion.org/borgmatic/). It's a Python wrapper for the award winning backup tool [borgbackup](https://borgbackup.readthedocs.io/en/stable/index.html) that simplifies creating secure and reliable backups even more. You can even store your configurations in files. This script will do the setup for you to. | [MIT]([LICENSE](https://git.zion-networks.de/ZionNetworks/linux-bash-scripts/src/branch/main/LICENSE)) | v1.2.0 | Bash | Debian and derivates | [bormatic_setup.sh](https://git.zion-networks.de/ZionNetworks/linux-bash-scripts/src/branch/main/borgmatic_setup.sh) | +| [Borgmatic Setup Tool](#borgmatic-setup-tool) | If you plan to use borg as backup solution, you should also take a look at [borgmatic](https://torsion.org/borgmatic/). It's a Python wrapper for the award winning backup tool [borgbackup](https://borgbackup.readthedocs.io/en/stable/index.html) that simplifies creating secure and reliable backups even more. You can even store your configurations in files. This script will do the setup for you to. | [MIT]([LICENSE](https://git.zion-networks.de/ZionNetworks/linux-bash-scripts/src/branch/main/LICENSE)) | v1.2.1 | Bash | Debian and derivates | [bormatic_setup.sh](https://git.zion-networks.de/ZionNetworks/linux-bash-scripts/src/branch/main/borgmatic_setup.sh) | #### Borgmatic Setup Tool @@ -28,7 +28,7 @@ For beginners, the fully automated installation is recommended. BST offers several command-line options to automate the whole process and get your backup schedule ready to go as fast as possible. -These options are available in version **1.2.0**: +These options are available in version **1.2.1**: ``` -a, --auto: Enable automatic, non-interactive mode diff --git a/borgmatic_setup.sh b/borgmatic_setup.sh index 7bffbd5..11ce773 100755 --- a/borgmatic_setup.sh +++ b/borgmatic_setup.sh @@ -64,7 +64,7 @@ OVERRIDE_REPOSITORY=0 # Set to 1 to override the existing backup repository readonly SCRIPT_NAME="Borgmatic Backup Setup Tool" readonly SCRIPT_AUTHOR="Zion Networks at admin@zion-networks.de" readonly SCRIPT_SUPPORT="admin@zion-networks.de" -readonly VERSION="1.2.0" +readonly VERSION="1.2.1" # logging functions function inf { @@ -626,7 +626,7 @@ fi # check if script is running on a supported OS (Ubuntu or Debian) if [ ! -f /etc/os-release ]; then - err "This script only supports Ubuntu and Debian" + err "This script currently only supports Ubuntu and Debian" exit 1 fi @@ -662,12 +662,12 @@ if [ $AUTO -eq 0 ] && ! wrnp "Do you want to continue? [y/N]"; then fi if ! check_command apt-get; then - err "apt-get is not installed. This script only supports Ubuntu and Debian." + err "apt-get is not installed. This script currently only supports Ubuntu and Debian." exit 1 fi if ! check_command dpkg; then - err "dpkg is not installed. This script only supports Ubuntu and Debian." + err "dpkg is not installed. This script only currently supports Ubuntu and Debian." exit 1 fi @@ -759,9 +759,11 @@ if ! inf_follow "Checking if borgmatic is installed..." "\e[1;32mYes\e[0m" "\e[1 fi else if [ $DO_UPGRADE_REQUIRED -eq 1 ]; then - if [ $AUTO -eq 0 ] && ! inf_follow "Upgrading borgmatic..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" pipx_upgrade borgmatic; then - err "Upgrade of borgmatic failed!" - exit 1 + if [ $AUTO -eq 1 ] || wrnp "Do you want to upgrade borgmatic? [y/N]"; then + if ! inf_follow "Upgrading borgmatic..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" pipx_upgrade borgmatic; then + err "Upgrade of borgmatic failed!" + exit 1 + fi fi fi fi @@ -852,7 +854,7 @@ if ! inf_follow "Checking if remote end has borg installed..." "\e[1;32mYes\e[0m fi fi else - if wrnp "The remote end does not have borg installed. Do you want to install it now? [y/N]"; then + if [ $AUTO -eq 1 ] || wrnp "The remote end does not have borg installed. Do you want to install it now? [y/N]"; then if ! inf_follow "Updating package repositories on remote end" "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command ssh -i "$SSH_KEY_FILE" -p "$SSH_PORT" -oStrictHostKeyChecking=no -oBatchMode=yes -l "$SSH_USER" "$SSH_HOST" apt-get update; then err "Failed to update package repositories on remote end." err "Please make sure you have the required access rights."