mirror of
https://github.com/pivpn/pivpn.git
synced 2025-01-20 19:39:46 +00:00
fix #100, checks exit code of dig with fallback
This commit is contained in:
parent
a68435e6c3
commit
d4111fa090
1 changed files with 26 additions and 16 deletions
|
@ -809,6 +809,16 @@ confNetwork() {
|
|||
|
||||
confOVPN() {
|
||||
IPv4pub=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "dig failed, now trying to curl eth0.me"
|
||||
IPv4pub=$(curl eth0.me)
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "eth0.me failed, please check your internet connection/DNS"
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
$SUDO cp /tmp/pivpnUSR /etc/pivpn/INSTALL_USER
|
||||
$SUDO cp /tmp/DET_PLATFORM /etc/pivpn/DET_PLATFORM
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue