fixed easyrsa install

wget command does not work and throws an error. "/tmp/EasyRSA-3.0.1-pivpn1/: Is a directory"
This is because the the output of wget is a directory, not a file. -O expects a file.
BN also, mv throws an error: "mv: cannot move `/tmp/EasyRSA-3.0.1-pivpn1' to `/etc/openvpn/easy-rsa': No such file or directory"
We can do a mkdir & wget & tar and move to do it in lesser steps, although less readable there are is no need for /tmp
This commit is contained in:
Bastiaan Nelissen 2016-12-08 12:52:55 +01:00 committed by GitHub
parent b632e69cdf
commit 939cd55694

View file

@ -707,14 +707,9 @@ confOpenVPN() {
fi
# Get the PiVPN easy-rsa
# BN. wget command does not work and throws an error. "/tmp/EasyRSA-3.0.1-pivpn1/: Is a directory"
# wget -q -O "/tmp/EasyRSA-${easyrsaVer}" "${easyrsaRel}"
# tar xzf /tmp/EasyRSA-${easyrsaVer} -C /tmp
wget -q -O "/tmp/EasyRSA-${easyrsaVer}.tgz" "${easyrsaRel}"
tar xzf /tmp/EasyRSA-${easyrsaVer}.tgz -C /tmp
$SUDO mv /tmp/EasyRSA-${easyrsaVer}/ /etc/openvpn/easy-rsa/
$SUDO mkdir -p /etc/openvpn/easy-rsa/pki && wget -q -O - "${easyrsaRel}" | $SUDO tar xz -C /etc/openvpn/easy-rsa
# fix ownership
$SUDO chown -R root:root /etc/openvpn/easy-rsa
$SUDO mkdir /etc/openvpn/easy-rsa/pki
# Write out new vars file
IFS= read -d '' String <<"EOF"