install_openvpn.sh: fix errors installing on debian 9 or down.
This commit is contained in:
parent
f24a991ad4
commit
20f0ebddd6
@ -1083,6 +1083,30 @@ else
|
||||
error "$(cat $log_file)"
|
||||
fi
|
||||
|
||||
# - Create Key Directory
|
||||
# -
|
||||
# - Note:
|
||||
# - Not needed on debian 10 or up. 'easyrsa init-pki' does the job.
|
||||
# -
|
||||
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 10 ]] ; then
|
||||
echononl " Create key directory '${OPENVPN_BASE_DIR}/keys'.."
|
||||
mkdir ${OPENVPN_BASE_DIR}/keys > "$log_file" 2>&1
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
echo_ok
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat $log_file)"
|
||||
fi
|
||||
echononl " Change permissions (700) in directory '${OPENVPN_BASE_DIR}/keys'.."
|
||||
chmod 700 "${OPENVPN_BASE_DIR}/keys" > "$log_file" 2>&1
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
echo_ok
|
||||
else
|
||||
echo_failed
|
||||
error "$(cat $log_file)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# - Create Log Directory
|
||||
# -
|
||||
openvpn_log_dir="/var/log/openvpn"
|
||||
@ -1105,7 +1129,7 @@ echononl " Create Client configuration directory '$OPENVPN_CCD_DIR'"
|
||||
if [[ -d "${OPENVPN_CCD_DIR}" ]] ; then
|
||||
echo_skipped
|
||||
else
|
||||
mkdir "${OPENVPN_CCD_DIR}" > "$log_file" 2>&1
|
||||
mkdir -p "${OPENVPN_CCD_DIR}" > "$log_file" 2>&1
|
||||
if [[ $? -eq 0 ]] ; then
|
||||
echo_ok
|
||||
else
|
||||
@ -1592,7 +1616,7 @@ fi
|
||||
echononl " Generates DH (Diffie-Hellman) parameters (dh key).."
|
||||
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 10 ]] ; then
|
||||
if [[ -f "${script_dir}/dh${KEY_SIZE}.pem" ]]; then
|
||||
cp "${script_dir}/dh${KEY_SIZE}.pem" "${OPENVPN_BASE_DIR}/dh${KEY_SIZE}.pem" > "$log_file" 2>&1
|
||||
cp "${script_dir}/dh${KEY_SIZE}.pem" "${OPENVPN_KEY_DIR}/dh${KEY_SIZE}.pem" > "$log_file" 2>&1
|
||||
else
|
||||
${EASY_RSA_DIR}/build-dh > "$log_file" 2>&1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user