workaround possibly missing lsb_release command
This commit is contained in:
parent
9c4a40b585
commit
1b4b2a2ff8
17
evocheck.sh
17
evocheck.sh
|
@ -126,11 +126,22 @@ IS_ALERTBOOT=1
|
||||||
IS_RSYNC=1
|
IS_RSYNC=1
|
||||||
|
|
||||||
DEBIAN_RELEASE=""
|
DEBIAN_RELEASE=""
|
||||||
|
LSB_RELEASE_BIN=$(command -v lsb_release)
|
||||||
OPENBSD_RELEASE=""
|
OPENBSD_RELEASE=""
|
||||||
|
|
||||||
if [ -e /etc/debian_version ]; then
|
if [ -e /etc/debian_version ]; then
|
||||||
DEBIAN_RELEASE=$(lsb_release -c -s)
|
DEBIAN_VERSION=$(cut -d "." -f 1 < /etc/debian_version)
|
||||||
DEBIAN_VERSION=$(cat /etc/debian_version |cut -d "." -f 1)
|
if [ -x ${LSB_RELEASE_BIN} ]; then
|
||||||
|
DEBIAN_RELEASE=$(${LSB_RELEASE_BIN} --codename --short)
|
||||||
|
else
|
||||||
|
case ${DEBIAN_VERSION} in
|
||||||
|
5) DEBIAN_RELEASE="lenny";;
|
||||||
|
6) DEBIAN_RELEASE="squeeze";;
|
||||||
|
7) DEBIAN_RELEASE="wheezy";;
|
||||||
|
8) DEBIAN_RELEASE="jessie";;
|
||||||
|
9) DEBIAN_RELEASE="stretch";;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
elif [ "$(uname -s)" = "OpenBSD" ]; then
|
elif [ "$(uname -s)" = "OpenBSD" ]; then
|
||||||
# use a better release name
|
# use a better release name
|
||||||
OPENBSD_RELEASE="OpenBSD"
|
OPENBSD_RELEASE="OpenBSD"
|
||||||
|
@ -179,7 +190,7 @@ is_debian() {
|
||||||
test -n "${DEBIAN_RELEASE}"
|
test -n "${DEBIAN_RELEASE}"
|
||||||
}
|
}
|
||||||
is_debian_lenny() {
|
is_debian_lenny() {
|
||||||
test "${DEBIAN_VERSION}" = "5"
|
test "${DEBIAN_VERSION}" = "lenny"
|
||||||
}
|
}
|
||||||
is_debian_squeeze() {
|
is_debian_squeeze() {
|
||||||
test "${DEBIAN_RELEASE}" = "squeeze"
|
test "${DEBIAN_RELEASE}" = "squeeze"
|
||||||
|
|
Loading…
Reference in a new issue