diff --git a/CHANGELOG.md b/CHANGELOG.md index 99110ee..c3c9ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # systemctl enable restic-backup@.timer ``` - **BREAKING CHANGE** moved script installation with makefile from `/usr/local/sbin` to `/bin` to have a simpler interface to work with `$PREFIX`. -- **BREAKING CHANGE** renamed `etc/restic/*.env` files to `etc/restic/*.env.sh` to clearly communicate that it's a shell script that will be executed (source), and also hint at code editors what file this is to set corect syntax highligting etc. +- **BREAKING CHANGE** renamed `etc/restic/*.env` files to `etc/restic/*.env.sh` to clearly communicate that it's a shell script that will be executed (source), and also hint at code editors what file this is to set corect syntax highligting etc. This also enables the shellcheck linter to work more easily on these files as well. - Renamed top level make install targets. The old `$ make install` is now `$ make install-systemd` ### Fixed diff --git a/etc/restic/_global.env.sh b/etc/restic/_global.env.sh index 01cd546..55a1ab3 100644 --- a/etc/restic/_global.env.sh +++ b/etc/restic/_global.env.sh @@ -1,3 +1,5 @@ +# shellcheck shell=sh + # Global envionment variables # These variables are sourced FIRST, and any values inside of *.env.sh files for # specific configurations will override if also defined there. diff --git a/etc/restic/default.env.sh b/etc/restic/default.env.sh index f48ea8b..7f26e70 100644 --- a/etc/restic/default.env.sh +++ b/etc/restic/default.env.sh @@ -1,3 +1,5 @@ +# shellcheck shell=sh + # This is the default profile. Fill it with your desired configuration. # Additionally, you can create and use more profiles by copying this file. @@ -9,7 +11,8 @@ # Thus you don't have to provide all the arguments like # $ restic --repo ... --password-file ... -source $INSTALL_PREFIX/etc/restic/_global.env.sh +# shellcheck source=etc/restic/_global.env.sh +. "$INSTALL_PREFIX/etc/restic/_global.env.sh" # Below envvar will override those in _global.env.sh