Add checkOS ()

This commit is contained in:
angristan 2018-09-17 14:58:09 +02:00
parent 931e82f5de
commit 243de3a4c4

View file

@ -21,20 +21,7 @@ function tunAvailable () {
fi fi
} }
function initialCheck () { function checkOS() {
if ! isRoot; then
echo "Sorry, you need to run this as root"
exit 1
elif ! tunAvailable; then
echo "TUN is not available"
exit 2
fi
}
# Main
initialCheck
if [[ -e /etc/debian_version ]]; then if [[ -e /etc/debian_version ]]; then
OS="debian" OS="debian"
# Getting the version number, to verify that a recent version of OpenVPN is available # Getting the version number, to verify that a recent version of OpenVPN is available
@ -78,7 +65,22 @@ else
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora or CentOS system" echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora or CentOS system"
exit 4 exit 4
fi fi
}
function initialCheck () {
if ! isRoot; then
echo "Sorry, you need to run this as root"
exit 1
elif ! tunAvailable; then
echo "TUN is not available"
exit 2
fi
checkOS
}
# Main
initialCheck
function newclient () { function newclient () {
echo "" echo ""