Add checkOS ()
This commit is contained in:
parent
931e82f5de
commit
243de3a4c4
1 changed files with 47 additions and 45 deletions
|
|
@ -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 ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue