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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
# Main
|
||||
|
||||
initialCheck
|
||||
|
||||
function checkOS() {
|
||||
if [[ -e /etc/debian_version ]]; then
|
||||
OS="debian"
|
||||
# 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"
|
||||
exit 4
|
||||
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 () {
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue