selfcheck checks one VPN type again

This commit is contained in:
shelleycat485 2020-05-25 15:24:50 +01:00
parent aa959ac9e3
commit 15804dff39
4 changed files with 14 additions and 43 deletions

View file

@ -13,8 +13,8 @@
# timestamp 2020/5/22 17:44BST
######## VARIABLES #########
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
#pivpnGitUrl="/home/pi/repos/pivpn"
#pivpnGitUrl="https://github.com/pivpn/pivpn.git"
pivpnGitUrl="/home/pi/repos/pivpn"
setupVarsFile="setupVars.conf"
setupConfigDir="/etc/pivpn"
tempsetupVarsFile="/tmp/setupVars.conf"

View file

@ -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
printf "=============================================\n"
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
/opt/pivpn/self_check.sh
/opt/pivpn/self_check.sh ${VPN}
printf "=============================================\n"
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"

View file

@ -1,7 +1,15 @@
#!/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}"
if [ "$VPN" = "wireguard" ]; then
@ -156,40 +164,3 @@ fi
if [ "$ERR" -eq 1 ]; then
echo -e "[INFO] Run \e[1mpivpn -d\e[0m again to see if we detect issues"
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

View file

@ -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
printf "=============================================\n"
echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::"
/opt/pivpn/self_check.sh
/opt/pivpn/self_check.sh ${VPN}
printf "=============================================\n"
echo -e ":::: Having trouble connecting? Take a look at the FAQ:"
echo -e ":::: \e[1mhttps://github.com/pivpn/pivpn/wiki/FAQ\e[0m"