From fdaad4e96f54bed478c987d869f82d01676af0a0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 25 Sep 2017 22:34:35 +0100 Subject: [PATCH] non-interactive vpn install --- src/freedombone-app-vpn | 42 ++++++----------------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/src/freedombone-app-vpn b/src/freedombone-app-vpn index 335686e5..4c9df8f7 100755 --- a/src/freedombone-app-vpn +++ b/src/freedombone-app-vpn @@ -163,19 +163,8 @@ function create_user_vpn_key { rm /etc/openvpn/easy-rsa/keys/$username.csr fi - echo ' - - - - - - - - - -y -y -' | ./build-key "$username" + sed -i 's| --interact||g' build-key + ./build-key "$username" if [ ! -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then echo $'VPN user cert not generated' @@ -303,29 +292,10 @@ function install_vpn { if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr fi - - echo ' - - - - - - - -' | ./build-ca - echo ' - - - - - - - - - -y -y -' | ./build-key-server $OPENVPN_SERVER_NAME + sed -i 's| --interact||g' build-key-server + sed -i 's| --interact||g' build-ca + ./build-ca + ./build-key-server $OPENVPN_SERVER_NAME if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then echo $'OpenVPN crt not found' exit 7823352