fix: Change INSTALL_PREFIX placeholder notation to templating notation (#131)
* refactor: Change INSTALL_PREFIX placeholder notation to templating notation
The former shell notation `$INSTALL_PREFIX` could result confusing. As
this is a placeholder that's replaced in the `make`, we switch it to a
template notation `{{ INSTALL_PREFIX }}`.
* docs: Small fix on README/manual setup
* docs(email-notif): Document the `{{ INSTALL_PREFIX }}` placeholder
co-authored-by: giuaig <13609224+giuaig@users.noreply.github.com>
* Update README.md
Co-authored-by: Gerard Bosch <30733556+gerardbosch@users.noreply.github.com>
---------
Co-authored-by: giuaig <13609224+giuaig@users.noreply.github.com>
Co-authored-by: Erik Westrup <erik.westrup@icloud.com>
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
# Why? Because of FreeBSD the system cron uses sendmail, and I want to use ssmtp.
|
||||
# Make your crontab files like:
|
||||
#SHELL=/bin/sh
|
||||
#PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:$INSTALL_PREFIX/bin
|
||||
#PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:{{ INSTALL_PREFIX }}/bin
|
||||
#@daily root cron_mail freebsd-update cron
|
||||
|
||||
mail_target=root
|
||||
|
||||
@@ -29,7 +29,7 @@ assert_envvars() {
|
||||
local varnames=("$@")
|
||||
for varname in "${varnames[@]}"; do
|
||||
if [ -z ${!varname+x} ]; then
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a $INSTALL_PREFIX/etc/restic/*.env.sh profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a {{ INSTALL_PREFIX }}/etc/restic/*.env.sh profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
@@ -97,7 +97,7 @@ B2_ARG=
|
||||
[ -z "${B2_CONNECTIONS+x}" ] || B2_ARG=(--option b2.connections="$B2_CONNECTIONS")
|
||||
|
||||
# If you need to run some commands before performing the backup; create this file, put them there and make the file executable.
|
||||
PRE_SCRIPT="${INSTALL_PREFIX}/etc/restic/pre_backup.sh"
|
||||
PRE_SCRIPT="{{ INSTALL_PREFIX }}/etc/restic/pre_backup.sh"
|
||||
test -x "$PRE_SCRIPT" && "$PRE_SCRIPT"
|
||||
|
||||
# Set up exclude files: global + path-specific ones
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ assert_envvars() {
|
||||
local varnames=("$@")
|
||||
for varname in "${varnames[@]}"; do
|
||||
if [ -z ${!varname+x} ]; then
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a $INSTALL_PREFIX/etc/restic/*.env.sh profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
printf "%s must be set for this script to work.\n\nDid you forget to source a {{ INSTALL_PREFIX }}/etc/restic/*.env.sh profile in the current shell before executing this script?\n" "$varname" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ eval "$(docopt "$@")"
|
||||
|
||||
# Exit on error, unbound variable, pipe error
|
||||
set -euo pipefail
|
||||
ENV_DIR=$INSTALL_PREFIX/etc/restic
|
||||
ENV_DIR="{{ INSTALL_PREFIX }}/etc/restic"
|
||||
|
||||
ERR_NO_SUCH_PROFILE=2
|
||||
ERR_PROFILE_NO_READ_PERM=3
|
||||
|
||||
Reference in New Issue
Block a user