Refactor my refactoring :)
This commit is contained in:
parent
3284a5f2f5
commit
75213a93ea
1 changed files with 7 additions and 7 deletions
|
|
@ -6,17 +6,13 @@
|
|||
# Functions
|
||||
|
||||
function isRoot () {
|
||||
if [[ "$EUID" -eq 0 ]]; then
|
||||
return 0
|
||||
else
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function tunAvailable () {
|
||||
if [[ -e /dev/net/tun ]]; then
|
||||
return 0
|
||||
else
|
||||
if [ ! -e /dev/net/tun ]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -78,6 +74,10 @@ function initialCheck () {
|
|||
checkOS
|
||||
}
|
||||
|
||||
function getNIC () {
|
||||
return $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
|
||||
}
|
||||
|
||||
function newclient () {
|
||||
echo ""
|
||||
echo "Do you want to protect the configuration file with a password?"
|
||||
|
|
@ -222,7 +222,7 @@ private-address: ::ffff:0:0/96' > /etc/unbound/openvpn.conf
|
|||
initialCheck
|
||||
|
||||
# Get Internet network interface with default route
|
||||
NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
|
||||
NIC=$(getNIC)
|
||||
|
||||
if [[ -e /etc/openvpn/server.conf ]]; then
|
||||
while :
|
||||
|
|
|
|||
Loading…
Reference in a new issue