mirror of
https://github.com/pivpn/pivpn.git
synced 2025-01-18 10:34:27 +00:00
selfcheck checks one VPN type again
This commit is contained in:
parent
aa959ac9e3
commit
15804dff39
4 changed files with 14 additions and 43 deletions
|
@ -13,8 +13,8 @@
|
||||||
# timestamp 2020/5/22 17:44BST
|
# timestamp 2020/5/22 17:44BST
|
||||||
|
|
||||||
######## VARIABLES #########
|
######## VARIABLES #########
|
||||||
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
#pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
||||||
#pivpnGitUrl="/home/pi/repos/pivpn"
|
pivpnGitUrl="/home/pi/repos/pivpn"
|
||||||
setupVarsFile="setupVars.conf"
|
setupVarsFile="setupVars.conf"
|
||||||
setupConfigDir="/etc/pivpn"
|
setupConfigDir="/etc/pivpn"
|
||||||
tempsetupVarsFile="/tmp/setupVars.conf"
|
tempsetupVarsFile="/tmp/setupVars.conf"
|
||||||
|
|
|
@ -28,7 +28,7 @@ echo -e ":::: \t\e[4mRecursive list of files in\e[0m\t ::::\n::: \e[4m/etc/openv
|
||||||
ls -LR /etc/openvpn/easy-rsa/pki/ -Ireqs -Icerts_by_serial
|
ls -LR /etc/openvpn/easy-rsa/pki/ -Ireqs -Icerts_by_serial
|
||||||
printf "=============================================\n"
|
printf "=============================================\n"
|
||||||
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
|
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
|
||||||
/opt/pivpn/self_check.sh
|
/opt/pivpn/self_check.sh ${VPN}
|
||||||
printf "=============================================\n"
|
printf "=============================================\n"
|
||||||
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
|
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
|
||||||
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"
|
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"
|
||||||
|
|
|
@ -1,7 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
runselfcheck()
|
# dual protocol, VPN type supplied as $1
|
||||||
{
|
|
||||||
|
setupVars="/etc/pivpn/${VPN}/setupVars.conf"
|
||||||
|
ERR=0
|
||||||
|
|
||||||
|
if [ ! -f "${setupVars}" ]; then
|
||||||
|
echo "::: Missing setup vars file!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
source "${setupVars}"
|
source "${setupVars}"
|
||||||
|
|
||||||
if [ "$VPN" = "wireguard" ]; then
|
if [ "$VPN" = "wireguard" ]; then
|
||||||
|
@ -156,40 +164,3 @@ fi
|
||||||
if [ "$ERR" -eq 1 ]; then
|
if [ "$ERR" -eq 1 ]; then
|
||||||
echo -e "[INFO] Run \e[1mpivpn -d\e[0m again to see if we detect issues"
|
echo -e "[INFO] Run \e[1mpivpn -d\e[0m again to see if we detect issues"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
} # end function
|
|
||||||
|
|
||||||
# now there are two places setupVars.conf can be, so check each one
|
|
||||||
|
|
||||||
dualprot='no'
|
|
||||||
setupVars="/etc/pivpn/wireguard/setupVars.conf"
|
|
||||||
ERR=0
|
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
|
||||||
echo "::: Missing ${setupVars}i, wireguard not installed"
|
|
||||||
else
|
|
||||||
echo ":: [OK] Selfcheck for wireguard, config from ${setupVars}"
|
|
||||||
runselfcheck
|
|
||||||
dualprot='yes'
|
|
||||||
fi
|
|
||||||
|
|
||||||
setupVars="/etc/pivpn/openvpn/setupVars.conf"
|
|
||||||
ERR=0
|
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
|
||||||
echo ":: Missing ${setupVars}, openvpn not installed"
|
|
||||||
else
|
|
||||||
echo ":: [OK] Selfcheck for openvpn, config from ${setupVars}"
|
|
||||||
runselfcheck
|
|
||||||
dualprot='yes'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# add check for a mixed up installation
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
|
||||||
|
|
||||||
if [[ ${dualprot} == 'yes' && -f "${setupVars}" ]]; then
|
|
||||||
echo ":: [ERR] Older ${setupVars} exists, should not be there,"
|
|
||||||
echo ":: [ERR] two incompatible versions have been installed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ echo -e ":::: \t\e[4mRecursive list of files in\e[0m\t ::::\n::::\e\t[4m/etc/wir
|
||||||
ls -LR /etc/wireguard
|
ls -LR /etc/wireguard
|
||||||
printf "=============================================\n"
|
printf "=============================================\n"
|
||||||
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
|
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
|
||||||
/opt/pivpn/self_check.sh
|
/opt/pivpn/self_check.sh ${VPN}
|
||||||
printf "=============================================\n"
|
printf "=============================================\n"
|
||||||
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
|
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
|
||||||
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"
|
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"
|
||||||
|
|
Loading…
Reference in a new issue