Added back Debian 10 support

This commit is contained in:
Orazio 2019-10-14 15:06:34 +02:00
parent 5e16322f9e
commit 1777d5c239
3 changed files with 60 additions and 30 deletions

View file

@ -1,10 +1,16 @@
#!/usr/bin/env bash
# PiVPN: revoke client script
install_user=$(</etc/pivpn/install_user)
PLAT=$(</etc/pivpn/DET_PLATFORM)
setupVars="/etc/pivpn/setupVars.conf"
INDEX="/etc/openvpn/easy-rsa/pki/index.txt"
if [ ! -f "${setupVars}" ]; then
echo "::: Missing setup vars file!"
exit 1
fi
source "${setupVars}"
helpFunc() {
echo "::: Revoke a client ovpn profile"
echo ":::"
@ -56,7 +62,7 @@ if [[ -z "${CERTS_TO_REVOKE}" ]]; then
done <${INDEX}
printf "\n"
echo "::: Please enter the Name of the client to be revoked from the list above:"
echo -n "::: Please enter the Name of the client to be revoked from the list above: "
read -r NAME
if [[ -z "${NAME}" ]]; then
@ -104,8 +110,6 @@ fi
cd /etc/openvpn/easy-rsa || exit
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
install_home=${install_home%/} # remove possible trailing slash
for (( ii = 0; ii < ${#CERTS_TO_REVOKE[@]}; ii++)); do
printf "\n::: Revoking certificate '"%s"'.\n" "${CERTS_TO_REVOKE[ii]}"
./easyrsa --batch revoke "${CERTS_TO_REVOKE[ii]}"

View file

@ -24,6 +24,7 @@ printf "=============================================\n"
echo -e ":::: \e[4mServer configuration shown below\e[0m ::::"
cd /etc/wireguard/keys
cp ../wg0.conf ../wg0.tmp
# Replace every key in the server configuration with just it's file name
for k in *; do
sed "s#$(cat "$k")#$k#" -i ../wg0.tmp
done
@ -148,7 +149,7 @@ else
fi
fi
# grep -w (whole word) is used so port 111940 with now match when looking for 1194
# grep -w (whole word) is used so port 11940 won't match when looking for 1194
if netstat -uanp | grep -w "${pivpnPORT}" | grep -q 'udp'; then
echo ":: [OK] WireGuard is listening on port ${pivpnPORT}/udp"
else