Add update-cron task

This commit is contained in:
Starbeamrainbowlabs 2019-08-09 23:45:32 +01:00
parent 614a383662
commit b57c77b400
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -46,6 +46,7 @@ if [[ "$#" -lt 1 ]]; then
echo -e "${CSECTION}Available actions${RS}"; echo -e "${CSECTION}Available actions${RS}";
echo -e " ${CACTION}setup${RS} - Perform initial setup"; echo -e " ${CACTION}setup${RS} - Perform initial setup";
echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository"; echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository";
echo -e " ${CACTION}update-cron${RS} - Like ${CACTION}update${RS}, but silent unless something goes wrong";
echo -e ""; echo -e "";
exit 1; exit 1;
@ -152,6 +153,17 @@ task_update() {
task_end $?; task_end $?;
} }
task_update-cron() {
tmpfile="$(mktmp --suffix ".aptosaurus.log")";
set +e;
bash "./aptosaurus.sh update" | ansi_strip >"${tmpfile}";
exit_code="${0}";
if [[ "${exit_code}" -ne 0 ]]; then
cat "${tmpfile}";
fi
}
############################################################################### ###############################################################################