Better logging for broken SSL
parent
4a8b5f7ea9
commit
4a96eb51be
|
@ -9,8 +9,6 @@
|
||||||
# 6: not root
|
# 6: not root
|
||||||
# 7: openssl failed
|
# 7: openssl failed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CONFIG_FILE='/etc/wgapi/config'
|
CONFIG_FILE='/etc/wgapi/config'
|
||||||
if ! [ ${#} -eq 3 ]; then
|
if ! [ ${#} -eq 3 ]; then
|
||||||
printf 'ERROR! Invalid number of arguments to %s: %s\n' "${0}" "${*}" >>"${LOGFILE}"
|
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}"
|
printf 'Signing SSL certs for %s.%s.%s...\n' "${hostname}" "${username}" "${TLD}" >>"${LOGFILE}"
|
||||||
|
|
||||||
# Make a directory for the new files
|
# Make a directory for the new files
|
||||||
if ! sudo mkdir "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/" >>"${LOGFILE}" 2>/dev/null; then
|
if ! res="$(sudo mkdir "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/")"; then
|
||||||
printf 'Failed to create directory %s/%s/%s/\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" >>"${LOGFILE}"
|
printf 'Failed to create directory %s/%s/%s/:\n%s\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" "${res}" >>"${LOGFILE}"
|
||||||
exit 7
|
exit 7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue