Use /bin/sh instead of ls to detect glibc (#13758)
* use ln instead of ls to detect glibc * use /bin/sh * remove echo
Emmanuel Vasilakis committed
Oct 4, 2022 at 18:25 UTC
78327ae80f5e7020b74d3b845fd10963fbb5374a
1 file changed
+1
-4
netdata-installer.sh
+1
-4
@@ -747,14 +747,11 @@ detect_libc() {
747
echo >&2 " Detected musl"
748
libc="musl"
749
else
750
- ls_path=$(command -v ls)
751
- if [ -n "${ls_path}" ] ; then
752
- cmd=$(ldd "$ls_path" | grep -w libc | cut -d" " -f 3)
750
+ cmd=$(ldd /bin/sh | grep -w libc | cut -d" " -f 3)
751
if bash -c "${cmd}" 2>&1 | grep -q -i "GNU C Library"; then
752
echo >&2 " Detected GLIBC"
753
libc="glibc"
754
fi
757
- fi
755
fi
756
757
if [ -z "$libc" ]; then