2
0
Fork 0

various changes

This commit is contained in:
Ducky 2022-03-02 00:59:59 +00:00
parent bed38d35e0
commit 685ff4f63f

View file

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