Merge pull request #14 from Heavybullets8/git-ver-check

place ver check after cd
This commit is contained in:
Heavybullets8 2022-08-24 11:43:39 +00:00 committed by GitHub
commit 51016ea135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,14 +1,13 @@
#!/bin/bash
#Version
hs_version=$(git describe --tags)
# cd to script, this ensures the script can find the source scripts below, even when ran from a seperate directory
script=$(readlink -f "$0")
script_path=$(dirname "$script")
script_name="heavy_script.sh"
cd "$script_path" || { echo "Error: Failed to change to script directory" ; exit ; }
#Version
hs_version=$(git describe --tags)
source functions/backup.sh
source functions/dns.sh