From 2d6fa28d5a5be7a881a2b74544b734836a547603 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Tue, 5 Dec 2023 02:06:04 +0200 Subject: [PATCH] Add fool-proof solution to support repo setup mode in Virtualmin API --- virtualmin-install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/virtualmin-install.sh b/virtualmin-install.sh index 696b999..984e476 100644 --- a/virtualmin-install.sh +++ b/virtualmin-install.sh @@ -140,6 +140,15 @@ while [ "$1" != "" ]; do esac done +# Force setup mode, if script name is `setup-repos.sh` as it +# is used by Virtualmin API, to make sure users won't run an +# actuall install script under any circumstances +if [ "${0##*/}" = "setup-repos.sh" ]; then + setup_only=1 + mode='setup' + unstable='unstable' +fi + # Store new log each time log="$pwd/$log_type.log" if [ -e "$log" ]; then