fix(updater): fix exit code when updating static install && updater script (#11873)
Ilya Mashchenko committed
Dec 8, 2021 at 20:38 UTC
e75f29b248337f828f9e4747925f5c9ffcc1b30d
1 file changed
+4
-2
packaging/installer/netdata-updater.sh
+4
-2
@@ -460,8 +460,10 @@ if [ "${IS_NETDATA_STATIC_BINARY}" == "yes" ]; then
460
461
echo "${install_type}" > /opt/netdata/etc/netdata/.install-type
462
463
- echo >&2 "Switching back to ${PREVDIR}"
464
- cd "${PREVDIR}"
463
+ if [ -e "${PREVDIR}" ]; then
464
+ echo >&2 "Switching back to ${PREVDIR}"
465
+ cd "${PREVDIR}"
466
+ fi
467
else
468
# the installer updates this script - so we run and exit in a single line
469
update && exit 0