commit
544fee9d9e
|
@ -26,19 +26,28 @@ getDistro () {
|
||||||
getDistro_os_id=''
|
getDistro_os_id=''
|
||||||
if test -r /etc/os-release; then
|
if test -r /etc/os-release; then
|
||||||
getDistro_os_id="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)"
|
getDistro_os_id="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)"
|
||||||
case "$getDistro_os_id" in
|
|
||||||
alpine|debian)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
getDistro_os_id=''
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
if test -n "$getDistro_os_id"; then
|
|
||||||
printf '%s' "$getDistro_os_id"
|
printf '%s' "$getDistro_os_id"
|
||||||
else
|
}
|
||||||
printf '%s' 'debian'
|
|
||||||
|
# Get the distribution name and the version
|
||||||
|
#
|
||||||
|
# Example output:
|
||||||
|
# alpine@3.10
|
||||||
|
# debian@9
|
||||||
|
getDistroVersion () {
|
||||||
|
getDistroVersion_distro="$(getDistro)"
|
||||||
|
if test -z "$getDistroVersion_distro"; then
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
|
getDistroVersion_versionID=''
|
||||||
|
if test -r /etc/os-release; then
|
||||||
|
getDistroVersion_versionID="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)"
|
||||||
|
fi
|
||||||
|
if test -z "$getDistroVersion_distro"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
printf '%s@%s' "$getDistroVersion_distro" "$getDistroVersion_versionID"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15)
|
# Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15)
|
||||||
|
|
Loading…
Reference in New Issue