fix(netdata-updater): properly handle update for debian packages (#12524)
Ilya Mashchenko committed
Mar 28, 2022 at 20:29 UTC
df32f93b9a6debde027f58b0cbeb2e7cfb4f643d
1 file changed
+3
-3
packaging/installer/netdata-updater.sh
+3
-3
@@ -672,7 +672,7 @@ update_binpkg() {
672
upgrade_cmd="upgrade"
673
pkg_install_opts="${interactive_opts}"
674
repo_update_opts="${interactive_opts}"
675
- pkg_installed_check="dpkg -l"
675
+ pkg_installed_check="dpkg -s"
676
INSTALL_TYPE="binpkg-deb"
677
;;
678
ubuntu)
@@ -681,7 +681,7 @@ update_binpkg() {
681
upgrade_cmd="upgrade"
682
pkg_install_opts="${interactive_opts}"
683
repo_update_opts="${interactive_opts}"
684
- pkg_installed_check="dpkg -l"
684
+ pkg_installed_check="dpkg -s"
685
INSTALL_TYPE="binpkg-deb"
686
;;
687
centos)
@@ -847,7 +847,7 @@ export NETDATA_LIB_DIR="${NETDATA_LIB_DIR:-${NETDATA_PREFIX}/var/lib/netdata}"
847
# Grab the nightlies baseurl (defaulting to our Google Storage bucket)
848
export NETDATA_NIGHTLIES_BASEURL="${NETDATA_NIGHTLIES_BASEURL:-https://storage.googleapis.com/netdata-nightlies}"
849
850
-if [ "${INSTALL_UID}" != "$(id -u)" ]; then
850
+if echo "$INSTALL_TYPE" | grep -qv ^binpkg && [ "${INSTALL_UID}" != "$(id -u)" ]; then
851
fatal "You are running this script as user with uid $(id -u). We recommend to run this script as root (user with uid 0)"
852
fi
853