From 3613eae1d971036ce91c6d31b822a129ba68e432 Mon Sep 17 00:00:00 2001 From: V33m <48420633+V33m@users.noreply.github.com> Date: Sun, 26 Apr 2020 11:25:46 +0200 Subject: [PATCH] Fallback if lsb_release -si does not return Ubuntu, Debian or Raspbian Adds a fallback if lsb_release -si returns anything else than Ubuntu, Debian or Raspbian. Should solve https://github.com/arakasi72/rtinst/issues/495. Needs testing and confirmation. --- scripts/rtinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rtinst b/scripts/rtinst index 958fbcf..1e828f2 100755 --- a/scripts/rtinst +++ b/scripts/rtinst @@ -202,8 +202,8 @@ fullrel=$(lsb_release -sd) osname=$(lsb_release -si) relno=$(lsb_release -sr | cut -d. -f1) -# Fallback if lsb_release -si returns nothing -if [ "$osname" = "" ]; then +# Fallback if lsb_release -si returns anything else than Ubuntu, Debian or Raspbian +if [ ! "$osname" = "ubuntu" ] && [ ! "$osname" = "debian" ] && [ ! "$osname" = "raspbian" ]; then osname=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') osname=${osname^} fi