Fix raspbian os detection

when doesn't it have lsb-release!?
This commit is contained in:
Kaladin Light 2016-05-15 21:43:32 -04:00
parent 2aad7f3c59
commit f0d92ab8df

View file

@ -64,12 +64,7 @@ If you think you received this message in error, you can post an issue on the Gi
exit 1 exit 1
} }
if hash lsb_release 2>/dev/null; then function maybeOS_Support() {
PLAT=$(lsb_release -si)
OSCN=$(lsb_release -sc) # We want this to be trusty xenial or jessie
if [[ $PLAT == "Ubuntu" || $PLAT == "Raspbian" || $PLAT == "Debian" ]]; then
if [[ $OSCN != "trusty" && $OSCN != "xenial" && $OSCN != "jessie" ]]; then
if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work.
Currently this installer supports Raspbian jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). Currently this installer supports Raspbian jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial).
Would you like to continue anyway?" $r $c) then Would you like to continue anyway?" $r $c) then
@ -79,10 +74,26 @@ if hash lsb_release 2>/dev/null; then
echo "::: Exiting due to unsupported OS" echo "::: Exiting due to unsupported OS"
exit 1 exit 1
fi fi
}
if hash lsb_release 2>/dev/null; then
PLAT=$(lsb_release -si)
OSCN=$(lsb_release -sc) # We want this to be trusty xenial or jessie
if [[ $PLAT == "Ubuntu" || $PLAT == "Raspbian" || $PLAT == "Debian" ]]; then
if [[ $OSCN != "trusty" && $OSCN != "xenial" && $OSCN != "jessie" ]]; then
maybeOS_Support
fi fi
else else
noOS_Support noOS_Support
fi fi
elif [[ "$(cat /etc/os-release | grep raspbian)" ]]; then
if [[ "$(cat /etc/os-release | grep jessie)" ]]; then
PLAT="Raspbian"
OSCN="jessie"
else
maybeOS_Support
fi
else else
noOS_Support noOS_Support
fi fi