2
0
Fork 0
main
Ducky 2023-08-22 00:38:45 +01:00
parent b8d80856f8
commit 5dc53f1963
2 changed files with 9 additions and 4 deletions

View File

@ -12,7 +12,7 @@ fi
me_filename="$(basename "$(realpath -s "$0")")"
backup_scripts_dir="$(get_config_dir "sh.zio.backup")/scripts"
cache_dir="/var/cache/sh.zio.backup/restic"
cache_dir="$(get_config_dir "sh.zio.backup" "/var/cache")/restic"
secrets_dir="$(get_config_dir "sh.zio.backup")/secrets"
host="$(hostname -s)"
now="$(date +"%Y-%m-%d %H:%M:%S")"

View File

@ -10,14 +10,19 @@ function die() {
}
function get_config_dir() {
prog="$1"
prog="$(echo $1 | sed -e "s/sh.zio.//g")"
prefix="/etc/zio"
if [[ -n "$2" ]]; then
prefix="$2"
fi
config_dir=""
if [[ ! -z $prog ]]; then
config_dir="/etc/zio/$prog"
config_dir="$prefix/$prog"
else
config_dir="/etc/zio"
config_dir="$prefix"
fi
if [[ ! -d "$config_dir" ]]; then