Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b23d552f0b |
@@ -6,11 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.0.1] - 2022-02-01
|
||||
### Fixed
|
||||
- Environment variable assertion should allow empty values e.g. `RESTIC_BACKUP_EXTRA_ARGS`
|
||||
|
||||
## [3.0.0] - 2022-02-01
|
||||
### Added
|
||||
- Allow extra arguments to restic-backup with `$RESTIC_BACKUP_EXTRA_ARGS`.
|
||||
- Add `$RESTIC_VERBOSITY_LEVEL` for debugging.
|
||||
- Assertion on all needed envionment variables in the backup and check scripts.
|
||||
- Assertion on all needed environment variables in the backup and check scripts.
|
||||
- Added linter (`shellcheck(1)`) that is run on push and PRs.
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -16,9 +16,8 @@ set -euo pipefail
|
||||
assert_envvars() {
|
||||
local varnames=("$@")
|
||||
for varname in "${varnames[@]}"; do
|
||||
# Check if variable is set, then if it is not empty (need to do both as of `set -u`).
|
||||
if [ -z ${!varname+x} ] || [ -z "${!varname}" ] ; then
|
||||
printf "%s must be set with a value for this script to work.\n\nDid you forget to source a /etc/restic/*.env profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
if [ -z ${!varname+x} ]; then
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a /etc/restic/*.env profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -9,9 +9,8 @@ set -euo pipefail
|
||||
assert_envvars() {
|
||||
local varnames=("$@")
|
||||
for varname in "${varnames[@]}"; do
|
||||
# Check if variable is set, then if it is not empty (need to do both as of `set -u`).
|
||||
if [ -z ${!varname+x} ] || [ -z "${!varname}" ] ; then
|
||||
printf "%s must be set with a value for this script to work.\n\nDid you forget to source a /etc/restic/*.env profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
if [ -z ${!varname+x} ]; then
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a /etc/restic/*.env profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user