build-hass/docker/bin/muslick.sh

36 lines
609 B
Bash
Executable File

#!/bin/bash
#
set -e
x() {
if [[ -x "$1" ]]; then
return 0
elif [[ "$1" =~ "/usr/" && -x "${1#/usr}" ]]; then
return 0
else
return 1
fi
}
# Check for musl libc
if x "/usr/lib/ld-musl-x86_64.so.1" ||
x "/usr/lib64/ld-musl-x86_64.so.1"; then
echo "musl C Library (musl) is in use."
MUSL="true" ; export MUSL
fi
# Check for glibc
if x "/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" ||
x "/usr/lib64/ld-linux-x86-64.so.2" ||
x "/usr/lib/ld-linux-x86-64.so.2"; then
echo "GNU C Library (glibc) is in use."
GLIBC="true" ; export GLIBC
fi