Prompt users about updates/claiming on unknown install types. (#13890)
Austin S. Hemmelgarn committed
Oct 31, 2022 at 07:53 UTC
9e85dc2bc98a8c7934744a239f3010cf67ef595c
1 file changed
+10
-2
packaging/installer/kickstart.sh
+10
-2
@@ -2,7 +2,7 @@
2
#
3
# SPDX-License-Identifier: GPL-3.0-or-later
4
#
5
-# Next unused error code: F050C
5
+# Next unused error code: F050D
6
7
# ======================================================================
8
# Constants
@@ -902,7 +902,15 @@ handle_existing_install() {
902
903
return 0
904
elif [ "${INSTALL_TYPE}" = "unknown" ]; then
905
- fatal "We do not support trying to update or claim installations when we cannot determine the install type. You will need to uninstall the existing install using the same method you used to install it to proceed." F0106
905
+ if [ "${INTERACTIVE}" -eq 0 ] && [ "${NETDATA_CLAIM_ONLY}" -eq 0 ]; then
906
+ fatal "We do not support trying to update or claim installations when we cannot determine the install type. You will need to uninstall the existing install using the same method you used to install it to proceed. If you just want to claim this install, you can re-run this command with the --claim-only option." F0106
907
+ elif [ "${INTERACTIVE}" -eq 1 ] && [ "${NETDATA_CLAIM_ONLY}" -eq 0 ]; then
908
+ if confirm "Attempting to update an existing install is not officially supported. It may work, but it also might break your system. If you just want to claim this install, you should re-run this command with the --claim-only option instead. Are you sure you want to continue?"; then
909
+ progress "OK, continuing"
910
+ else
911
+ fatal "Cancelling update of unknown installation type at user request." F050C
912
+ fi
913
+ fi
914
fi
915
916
ret=0