diff --git a/auto_update/auto_update.sh b/auto_update/auto_update.sh new file mode 100644 index 0000000..5221e60 --- /dev/null +++ b/auto_update/auto_update.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +set -eu + +readonly app_name=seafile + +get_from_manifest() { + result=$(python3 <&1 | tee "${app_name}_build_temp.log" + return "${PIPESTATUS[0]}" +} + +app_version=$(get_from_manifest ".version" | cut -d'~' -f1) + +if check_app_version +then + set +eu + upgrade_app + res=$? + set -eu + if [ $res -eq 0 ]; then + result="Success" + else + result="Failed" + fi + msg="Build: $app_name version $app_version\n" + msg+="$(cat ${app_name}_build_temp.log)" + echo -e "$msg" | mail.mailutils -a "Content-Type: text/plain; charset=UTF-8" -s "Autoupgrade $app_name : $result" "$notify_email" +fi