diff --git a/duplicacy.sh b/duplicacy.sh index 219a022..c17590b 100644 --- a/duplicacy.sh +++ b/duplicacy.sh @@ -12,6 +12,39 @@ fi trap "rm -f ${lockfile}; exit" INT TERM EXIT echo $$ > ${lockfile} +# Determine the Kernel and Architecture +KERNEL=$(uname) +ARCH=$(uname -m) +if [${KERNEL} == 'Linux']; then + if [ ${ARCH} == 'x86_64' ]; then + cp -v $(dirname "$0")/binaries/duplicacy_linux_x64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE} + chown +x /usr/bin/duplicacy >> ${LOGFILE} + elif [ ${ARCH} == 'aarch64' ]; then + cp -v $(dirname "$0")/binaries/duplicacy_linux_arm64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE} + chown +x /usr/bin/duplicacy >> ${LOGFILE} + else + echo "Kernel Type: ${KERNEL}" + echo "Arch: ${ARCH}" + echo "Arch not supported." + exit + fi +elif [${KERNEL} == 'FreeBSD']; then + if [ ${ARCH} == 'amd64' ]; then + cp -v $(dirname "$0")/binaries/duplicacy_freebsd_x64_2.6.1 /usr/bin/duplicacy >> ${LOGFILE} + chown +x /usr/bin/duplicacy >> ${LOGFILE} + else + echo "Kernel Type: ${KERNEL}" + echo "Arch: ${ARCH}" + echo "Arch not supported." + exit + fi +else + echo "Kernel Type: ${KERNEL}" + echo "Arch: ${ARCH}" + echo "Kernel not supported." + exit +fi + # run the backup cd / duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1