From bd13cdd56625fdec75aeb5380d0a2bee0924ebac Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 8 Sep 2023 11:49:36 +0000 Subject: [PATCH] Fixed path usage. --- config.sh.example | 0 db-backup.sh | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 config.sh.example diff --git a/config.sh.example b/config.sh.example old mode 100644 new mode 100755 diff --git a/db-backup.sh b/db-backup.sh index 2caee45..5c9bf94 100755 --- a/db-backup.sh +++ b/db-backup.sh @@ -4,16 +4,20 @@ filename="$(hostname) $(date +'%Y-%m-%d %H%M%S')" skip_dbs=("mysql" "information_schema" "performance_schema" "sys") tmpdir="/tmp/fw-db-backup" workdir="$tmpdir/$filename" + mariadb_user="" mariadb_pass="" db_backups_depot="." -if [ ! -e config.sh ]; then +current_dir="$(dirname "$0")" +config_path="$current_dir/config.sh" + +if [ ! -e "$config_path" ]; then echo "config.sh not found, copy config.sh.example if you haven't yet" exit 1 fi -source ./config.sh +source "$config_path" echo "Resetting temp directory..." rm -rf "$tmpdir"