From 939cd556946853f0fd40d899bf3a1266da5263b5 Mon Sep 17 00:00:00 2001 From: Bastiaan Nelissen Date: Thu, 8 Dec 2016 12:52:55 +0100 Subject: [PATCH] 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 --- auto_install/install.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index b2364e5..928b3ea 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -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"