mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Allow (potentially) unsupported network interfaces via the '--show-unsupported-nics' argument
This commit is contained in:
parent
61c7151e3b
commit
ba4c2c91db
1 changed files with 10 additions and 2 deletions
|
@ -62,6 +62,7 @@ OPENVPN_KEY_URL="https://swupdate.openvpn.net/repos/repo-public.gpg"
|
||||||
runUnattended=false
|
runUnattended=false
|
||||||
skipSpaceCheck=false
|
skipSpaceCheck=false
|
||||||
reconfigure=false
|
reconfigure=false
|
||||||
|
showUnsupportedNICs=false
|
||||||
|
|
||||||
######## SCRIPT ########
|
######## SCRIPT ########
|
||||||
|
|
||||||
|
@ -106,6 +107,7 @@ main(){
|
||||||
"--i_do_not_follow_recommendations" ) skipSpaceCheck=false;;
|
"--i_do_not_follow_recommendations" ) skipSpaceCheck=false;;
|
||||||
"--unattended" ) runUnattended=true;;
|
"--unattended" ) runUnattended=true;;
|
||||||
"--reconfigure" ) reconfigure=true;;
|
"--reconfigure" ) reconfigure=true;;
|
||||||
|
"--show-unsupported-nics" ) showUnsupportedNICs=true;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -556,8 +558,14 @@ local chooseInterfaceOptions
|
||||||
# Loop sentinel variable
|
# Loop sentinel variable
|
||||||
local firstloop=1
|
local firstloop=1
|
||||||
|
|
||||||
# Find network interfaces whose state is UP, so as to skip virtual interfaces and the loopback interface
|
if [[ "${showUnsupportedNICs}" == true ]]; then
|
||||||
availableInterfaces=$(ip -o link | awk '/state UP/ {print $2}' | cut -d':' -f1 | cut -d'@' -f1)
|
# Show every network interface, could be useful for those who install PiVPN inside virtual machines
|
||||||
|
# or on Raspberry Pis with USB adapters (the loopback interfaces is still skipped)
|
||||||
|
availableInterfaces=$(ip -o link | awk '{print $2}' | cut -d':' -f1 | cut -d'@' -f1 | grep -v -w 'lo')
|
||||||
|
else
|
||||||
|
# Find network interfaces whose state is UP, so as to skip virtual interfaces and the loopback interface
|
||||||
|
availableInterfaces=$(ip -o link | awk '/state UP/ {print $2}' | cut -d':' -f1 | cut -d'@' -f1)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$availableInterfaces" ]; then
|
if [ -z "$availableInterfaces" ]; then
|
||||||
echo "::: Could not find any active network interface, exiting"
|
echo "::: Could not find any active network interface, exiting"
|
||||||
|
|
Loading…
Reference in a new issue