Add update-cron task
This commit is contained in:
parent
614a383662
commit
b57c77b400
1 changed files with 14 additions and 2 deletions
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue