get-os.sh: Fix opensuse leap detection

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-02-28 15:16:55 +00:00
commit f137257d3e

View file

@ -44,43 +44,45 @@ cmd_name_version()
. /etc/os-release
if [ "$opt_verbose" ]; then
echo $NAME $VERSION
else
if grep -qi tumbleweed /etc/os-release; then
echo suse-tumbleweed
else
if [ "$ID" != ubuntu ]; then
[ "$ID_LIKE" ] && ID=$ID_LIKE
fi
case "$ID" in
debian)
VERSION_NAME=`echo $PRETTY_NAME | awk 'NF>1{print $NF}' | sed 's%/.*%%' | tr '[A-Z]' '[a-z]'`
case $VERSION_NAME in
buster) VERSION_ID=10;;
stretch) VERSION_ID=9;;
jessie) VERSION_ID=8;;
wheezy) VERSION_ID=7;;
squeeze) VERSION_ID=6.0;;
lenny) VERSION_ID=5.0;;
etch) VERSION_ID=4.0;;
sarge) VERSION_ID=3.1;;
woody) VERSION_ID=3.0;;
potato) VERSION_ID=2.2;;
slink) VERSION_ID=2.1;;
hamm) VERSION_ID=2.0;;
*)
;;
esac
;;
ubuntu)
;;
*)
VERSION_ID=42
;;
esac
echo $ID-$VERSION_ID | sed 's/opensuse/suse/g'
fi
exit 0
fi
exit
if grep -qi tumbleweed /etc/os-release; then
echo suse-tumbleweed
exit 0
fi
if [ "$ID" != ubuntu ]; then
[ "$ID_LIKE" ] && ID=$ID_LIKE
fi
case "$ID" in
debian)
VERSION_NAME=`echo $PRETTY_NAME | awk 'NF>1{print $NF}' | sed 's%/.*%%' | tr '[A-Z]' '[a-z]'`
case $VERSION_NAME in
buster) VERSION_ID=10;;
stretch) VERSION_ID=9;;
jessie) VERSION_ID=8;;
wheezy) VERSION_ID=7;;
squeeze) VERSION_ID=6.0;;
lenny) VERSION_ID=5.0;;
etch) VERSION_ID=4.0;;
sarge) VERSION_ID=3.1;;
woody) VERSION_ID=3.0;;
potato) VERSION_ID=2.2;;
slink) VERSION_ID=2.1;;
hamm) VERSION_ID=2.0;;
*)
;;
esac
;;
ubuntu)
;;
suse|opensuse)
;;
*)
VERSION_ID=42
;;
esac
echo $ID-$VERSION_ID | sed 's/opensuse/suse/g'
exit 0
fi
if [ -e /etc/SuSE-release ]; then