mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fix raspbian os detection
when doesn't it have lsb-release!?
This commit is contained in:
parent
2aad7f3c59
commit
f0d92ab8df
1 changed files with 18 additions and 7 deletions
|
@ -64,13 +64,8 @@ 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)
|
if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work.
|
||||||
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.
|
|
||||||
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
|
||||||
echo "::: Did not detect perfectly supported OS but,"
|
echo "::: Did not detect perfectly supported OS but,"
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue