diff --git a/back/lib/ssl_peer_add b/back/lib/ssl_peer_add index 43df69b..ce49afa 100755 --- a/back/lib/ssl_peer_add +++ b/back/lib/ssl_peer_add @@ -9,8 +9,6 @@ # 6: not root # 7: openssl failed - - CONFIG_FILE='/etc/wgapi/config' if ! [ ${#} -eq 3 ]; then printf 'ERROR! Invalid number of arguments to %s: %s\n' "${0}" "${*}" >>"${LOGFILE}" @@ -34,8 +32,8 @@ ipstring="${3}" printf 'Signing SSL certs for %s.%s.%s...\n' "${hostname}" "${username}" "${TLD}" >>"${LOGFILE}" # Make a directory for the new files -if ! sudo mkdir "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/" >>"${LOGFILE}" 2>/dev/null; then - printf 'Failed to create directory %s/%s/%s/\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" >>"${LOGFILE}" +if ! res="$(sudo mkdir "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/")"; then + printf 'Failed to create directory %s/%s/%s/:\n%s\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" "${res}" >>"${LOGFILE}" exit 7 fi