Improved version parsing. Fix bug on MacOS (thanks @ErebusBat)
This commit is contained in:
parent
2389ee61db
commit
0c4f2b7c45
1 changed files with 13 additions and 3 deletions
|
|
@ -126,12 +126,22 @@ version_compare() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# set a flag if duplicity's version is lower than 0.7, for usage later in the script
|
||||||
version_compare "${DUPLICITY_VERSION}" 0.7
|
version_compare "${DUPLICITY_VERSION}" 0.7
|
||||||
case $? in 2) LT07=1;; *) LT07=0;; esac
|
case $? in 2) LT07=1;; *) LT07=0;; esac
|
||||||
|
|
||||||
# Read the version string from the file VERSION
|
# Read the version string from the file named VERSION in the same directory as the script.
|
||||||
DBSH_DIRPATH=$(dirname "$(readlink -f "$0")")
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
DBSH_VERSION=$(<"${DBSH_DIRPATH}/VERSION")
|
DBSH_VERPATH="$(dirname "$(readlink "$0")")/VERSION"
|
||||||
|
else
|
||||||
|
DBSH_VERPATH="$(dirname "$(readlink -f "$0")")/VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -r "${DBSH_VERPATH}" ]; then
|
||||||
|
DBSH_VERSION=$(<"${DBSH_VERPATH}")
|
||||||
|
else
|
||||||
|
DBSH_VERSION=unknown
|
||||||
|
fi
|
||||||
|
|
||||||
version(){
|
version(){
|
||||||
echo "duplicity-backup.sh ${DBSH_VERSION}"
|
echo "duplicity-backup.sh ${DBSH_VERSION}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue