git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormail_redacted_for_web 2026-03-07 11:05:47 +0100
committermail_redacted_for_web 2026-03-07 11:05:47 +0100
commit05f529061606d7c7ab94e390074526256079815b (patch)
tree6474aba12d0350243237bac995c91af45f4354da
parentf5b86f5ab284fe969358463d472aac2d36d38664 (diff)
downloadnextcloud-update-05f529061606d7c7ab94e390074526256079815b.tar.bz2
Move file sourcing, extend help
1. Move "external" sourced files in a place where they aren't failing before something essential like the help function 2. Tell the user about the required files in the help text 3. Tell the user that -upgrade is rather to be called from somewhere else (in a built package, this may later reside in a /lib folder)
-rwxr-xr-xbin/nextcloud-update14
-rwxr-xr-xbin/nextcloud-upgrade5
2 files changed, 10 insertions, 9 deletions
diff --git a/bin/nextcloud-update b/bin/nextcloud-update
index 48dd580..bae29f1 100755
--- a/bin/nextcloud-update
+++ b/bin/nextcloud-update
@@ -30,11 +30,6 @@
# the feeble parts of updater.phar - Nextcloud itself is still a nice product, it's just
# a bit poisoned by morons who want to make the lifes of destructive hackers easier.
-# shellcheck disable=SC1091
-source /etc/lirion/nextcloud.conf || exit 1
-# shellcheck disable=SC1091
-source /usr/lib/lirion/ln-initfunctions || exit 2
-
# YEAH CODE!
# Mark this: we call other scripts here which should be bundled with this script (precisely: anything
# called /usr/local/bin/nextcloud-*).
@@ -57,6 +52,10 @@ function hayulp {
printf -- '--help;This help text\n'
)|column -ts \;
printf '\n'
+ printf 'Required files:\n'
+ printf '\t- /etc/lirion/nextcloud.conf (example see /etc in the code source)\n'
+ printf '\t- /usr/lib/lirion/ln-initfunctions (e.g. through package ln-initfunctions)\n'
+ printf '\n'
}
# User variables: imperatives whether to do app/core updates, print status, print update check.
@@ -101,6 +100,11 @@ while [[ $# -gt 0 ]]; do
esac
done
+# shellcheck disable=SC1091
+source /etc/lirion/nextcloud.conf || exit 1
+# shellcheck disable=SC1091
+source /usr/lib/lirion/ln-initfunctions || exit 2
+
if [[ "$NC_STATDSP" -eq 0 && "$NC_APPSUPD" -eq 0 && "$NC_COREUPD" -eq 0 && "$NC_UPCHECK" -eq 0 ]]; then
hayulp
printf '\033[93mNo action chosen, please read the help text above.\033[0m\n' >&2
diff --git a/bin/nextcloud-upgrade b/bin/nextcloud-upgrade
index 4dec0aa..bfb4d7f 100755
--- a/bin/nextcloud-upgrade
+++ b/bin/nextcloud-upgrade
@@ -8,16 +8,13 @@
# Define help function
function hayulp {
printf 'USAGE: %b [-a|--app-update] [-c|--core-update VERSION]\n\n' "$(basename "$0")"
+ printf '\033[3mThis is supposed to be called by "nextcloud-update".\033[0m\n\n'
(
printf -- '-a,\n'
printf -- '--app-update;Update all apps\n'
printf -- '-c,\n'
printf -- '--core-update;Update the Nextcloud core (including apps update)\n'
printf -- ';VERSION is mandatory. "0" for no update at all (e.g. for wrapper scripts).\n'
- printf -- '-s,\n'
- printf -- '--status;Status including version\n'
- printf -- '-u,\n'
- printf -- '--update-check;Status including update check\n'
printf -- '-h,\n'
printf -- '--help;This help text\n'
)|column -ts \;