summaryrefslogblamecommitdiffstats
path: root/common/init.sh
blob: a955f18f3c0487713eaaf548a065e59ce2faa532 (plain) (tree)




















                                                                       
# init common function for backup

# get path to common script dir
if [ -z "${BACKUP_ROOT}" -o ! -d "${BACKUP_ROOT}/common/" ]; then
    echo "\$BACKUP_ROOT not set or invalid! (common dir not there)" >&2
    echo "Please set it to the path to the root directory of the" >&2
    echo "backup scripts before sourcing this init.sh file." >&2
    exit 1
fi

# load all common scripts
for file in ${BACKUP_ROOT}/common/*
do
    if [ "$(basename ${file})" != "init.sh" ]; then
	source "${file}"
    fi
done

# check if git is available for update
_check_tools git
_self_update