2
0
Fork 0

various changes

main
Ducky 2022-03-02 00:59:59 +00:00
parent bed38d35e0
commit 685ff4f63f
1 changed files with 9 additions and 10 deletions

View File

@ -101,13 +101,14 @@ function test_path() {
host="$(hostname -s)"
repo="b2:zio-euc-servers"
passwd_file="$env_dir/passwd"
pre_script_file="$env_dir/pre-script"
post_script_file="$env_dir/post-script"
b2_account_id=""
b2_account_key=""
excludes=()
paths=()
passwd_file=""
pre_script=""
post_script=""
services=()
if [[ $UID != 0 ]]; then
@ -136,9 +137,7 @@ else
IFS=';' read -ra services <<< "$(get_prop "$env_dir/config" SERVICES)"
fi
if [[ -f "$env_dir/passwd" ]]; then
passwd_file="$env_dir/passwd"
else
if [[ ! -f "$env_dir/passwd" ]]; then
say_die "Password file ($passwd_file) not found."
fi
fi
@ -157,9 +156,9 @@ else
export B2_ACCOUNT_ID="$b2_account_ID"
fi
if [[ ! -z $pre_script ]]; then
if [[ ! -f $pre_script_file ]]; then
say_do "Executing pre-backup script..."
. $pre_script
. $pre_script_file
fi
say_do "Stopping services..."
@ -180,9 +179,9 @@ do
systemctl start $service
done
if [[ ! -z $post_script ]]; then
if [[ ! -z $post_script_file ]]; then
say_do "Executing post-backup script..."
. $post_script
. $post_script_file
fi
say_do "Removing old backups..."