diff --git a/CHANGELOG.md b/CHANGELOG.md index dd8596e5..6ee4d38c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,12 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Changed +* rbenv: install Ruby 3.1.0 by default +* evolinux-base: backup-server-state: add "force" mode ### Fixed +* evolinux-base: backup-server-state: fix systemctl invocation + ### Removed ### Security diff --git a/evolinux-base/files/backup-server-state.sh b/evolinux-base/files/backup-server-state.sh index 9febcbe6..8e64c423 100644 --- a/evolinux-base/files/backup-server-state.sh +++ b/evolinux-base/files/backup-server-state.sh @@ -2,7 +2,7 @@ PROGNAME="backup-server-state" -VERSION="22.01.2" +VERSION="22.01.3" readonly VERSION backup_dir= @@ -14,7 +14,7 @@ show_version() { cat <, +Copyright 2018-2022 Evolix , Jérémy Lecour and others. @@ -31,6 +31,7 @@ Usage: ${PROGNAME} --backup-dir=/path/to/backup/directory [OPTIONS] Options -d, --backup-dir path to the directory where the backup will be stored + -f, --force keep existing backup directory and its content --etc backup copy of /etc --no-etc no backup copy of /etc (default) --dpkg backup copy of /var/lib/dpkg @@ -680,7 +681,7 @@ backup_systemctl() { systemctl_bin=$(command -v systemctl) if [ -n "${systemctl_bin}" ]; then - last_result=$(${systemctl_bin} systemctl --no-legend --state=failed --type=service > "${backup_dir}/systemctl-failed-services.txt") + last_result=$(${systemctl_bin} --no-legend --state=failed --type=service > "${backup_dir}/systemctl-failed-services.txt") last_rc=$? if [ ${last_rc} -eq 0 ]; then @@ -703,8 +704,10 @@ main() { fi if [ -d "${backup_dir}" ]; then - echo "ERROR: The backup directory ${backup_dir} already exists. Delete it first." >&2 - exit 2 + if [ "${FORCE}" != "1" ]; then + echo "ERROR: The backup directory ${backup_dir} already exists. Delete it first." >&2 + exit 2 + fi else create_backup_dir fi @@ -794,6 +797,10 @@ while :; do VERBOSE=1 ;; + -f|--force) + FORCE=1 + ;; + -d|--backup-dir) # with value separated by space if [ -n "$2" ]; then @@ -982,6 +989,7 @@ done # Default values : "${VERBOSE:=0}" +: "${FORCE:=0}" : "${DO_ETC:=0}" : "${DO_DPKG_FULL:=0}" : "${DO_DPKG_STATUS:=1}" diff --git a/rbenv/defaults/main.yml b/rbenv/defaults/main.yml index 5d6c5e6b..5454547f 100644 --- a/rbenv/defaults/main.yml +++ b/rbenv/defaults/main.yml @@ -1,6 +1,6 @@ --- -rbenv_version: v1.1.2 -rbenv_ruby_version: 2.7.0 +rbenv_version: v1.2.0 +rbenv_ruby_version: 3.1.0 rbenv_root: "~/.rbenv" rbenv_repo: "https://github.com/rbenv/rbenv.git" rbenv_plugins: