git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/nextcloud-update33
1 files changed, 19 insertions, 14 deletions
diff --git a/bin/nextcloud-update b/bin/nextcloud-update
index c88d11c..ae15ef3 100755
--- a/bin/nextcloud-update
+++ b/bin/nextcloud-update
@@ -164,8 +164,16 @@ if [ "$NC_APPSUPD" -eq 1 ]; then
lnbegin "Parse: apps updates"
# TODO: look at update:check again and see what to grep(!) for (again, the script doesn't deliver
# return codes, nor does the crappy output at least have a json flag)
- lnwarn "not yet implemented"
- exit 255
+ # example output:
+ # Update for calendar to version 5.2.2 is available.
+ # Update for mail to version 5.0.2 is available.
+ # 2 updates available
+ if ! /usr/bin/printf '%b' "$UPDSTR" | grep -P '^[0-9]+ updates? available\.?$' > /dev/null; then
+ lnok 'none available'
+ else
+ lnok 'app updates available'
+ NC_UA_APPS=1
+ fi
fi
@@ -184,18 +192,15 @@ fi
# printf 'NC_UA_CORE: %b\n' "$NC_UA_CORE"
# printf 'NC_APPSUPD: %b\n' "$NC_APPSUPD"
# printf 'NC_UA_APPS: %b\n' "$NC_UA_APPS"
-if [[ "$NC_COREUPD" -eq 1 || "$NC_APPSUPD" -eq 1 ]]; then
- UPDCALL=( '/usr/local/bin/nextcloud-upgrade' )
- if [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 1 ]]; then
- UPDCALL+=( '-c' "$UPDVER" )
- elif [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 0 ]]; then
- UPDCALL+=( '-c' 0 )
- fi
- if [[ "$NC_APPSUP" -eq 1 && "$NX_UA_APPS" -eq 1 ]]; then
- UPDCALL+=( '-a' )
- fi
-else
- UPDCALL='/usr/bin/true'
+UPDCALL=( '/usr/local/bin/nextcloud-upgrade' )
+if [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 1 ]]; then
+ UPDCALL+=( '-c' "$UPDVER" )
+elif [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 0 ]]; then
+ UPDCALL+=( '-c' 0 )
+fi
+if [[ "$NC_APPSUPD" -eq 1 && "$NC_UA_APPS" -eq 1 ]]; then
+ echo BENIS
+ UPDCALL+=( '-a' )
fi
# /usr/local/bin/nextcloud-upgrade "$UPDVER" || exit "$?"
"${UPDCALL[@]}" || exit "$?"