diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2022-02-10 06:47:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 06:47:33 -0500 |
commit | b0b0a12da71c634ba05df8fa5457a7c122c5d5c1 (patch) | |
tree | e10a1ce3158edde26c20e4c36c5977dc318f70fc | |
parent | 8fcd31b32209ce841eba2028a1c2c61d8b1d6e6b (diff) |
Properly handle non-interactive installs as non-root users. (#12089)
THis ensures that `sudo` and `doas` properly fail when we are running
non-interactively if they would require the user to input a password.
-rwxr-xr-x | packaging/installer/kickstart.sh | 12 | ||||
-rw-r--r-- | packaging/installer/methods/kickstart.md | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 0b396e4d61..d37e34a45d 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -462,11 +462,19 @@ str_in_list() { confirm_root_support() { if [ "$(id -u)" -ne "0" ]; then if [ -z "${ROOTCMD}" ] && command -v sudo > /dev/null; then - ROOTCMD="sudo" + if [ "${INTERACTIVE}" -eq 0 ]; then + ROOTCMD="sudo -n" + else + ROOTCMD="sudo" + fi fi if [ -z "${ROOTCMD}" ] && command -v doas > /dev/null; then - ROOTCMD="doas" + if [ "${INTERACTIVE}" -eq 0 ]; then + ROOTCMD="doas -n" + else + ROOTCMD="doas" + fi fi if [ -z "${ROOTCMD}" ] && command -v pkexec > /dev/null; then diff --git a/packaging/installer/methods/kickstart.md b/packaging/installer/methods/kickstart.md index 1726b0b318..fadb88076b 100644 --- a/packaging/installer/methods/kickstart.md +++ b/packaging/installer/methods/kickstart.md @@ -136,7 +136,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do run the following: ```bash -[ "862580a7c6e4b973b6fcfd907e2f1bbc" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "0cfdc04fd4004f77ebc3c1e564ee6476" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` If the script is valid, this command will return `OK, VALID`. |