Less clutter in logs

master
Keith Irwin 2022-09-10 14:54:44 -06:00
parent efff4c0026
commit e5acd59c46
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 2 additions and 5 deletions

View File

@ -103,5 +103,3 @@ if ! sudo rm "${SSL_CONFIG_DIR}/${username}/${hostname}.cnf" "${SSL_CONFIG_DIR}/
printf 'Failed to remove old SSL config files %s/%s/%s.cnf\n' "${SSL_CONFIG_DIR}" "${username}" "${hostname}" >>"${LOGFILE}"
exit 7
fi
printf 'SSL certs for %s.%s.%s are ready\n' "${hostname}" "${username}" "${TLD}" >>"${LOGFILE}"

View File

@ -58,7 +58,6 @@ printf '%s identified as %s\n' "${ip}" "${username}" >>"${LOGFILE}"
domain="${hostname}.${username}.${TLD}"
# Check if new peer already exists
printf "${hostname}" >>"${LOGFILE}"
if "${LIB_DIR}/ns_lookup_send" "${domain}" >/dev/null; then
printf '%s.%s.%s already exists!\n' "${hostname}" "${username}" "${TLD}" >>"${LOGFILE}"
printf 'Hostname %s already exists!\n' "${hostname}" | "${LIB_DIR}/http_res" 409
@ -131,12 +130,12 @@ wg_config="[Interface] # ${hostname}.${username}.${TLD}\nPrivateKey=${privkey}\n
# Update nameserver
if "${LIB_DIR}/ns_update_add" "${domain}" "${ipv4}" "${ipv6}"
then printf 'Successfully added %s %s %s to DNS server.\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
then printf 'Successfully added %s to DNS server.\n' "${domain}" >>"${LOGFILE}"
else printf 'ERROR! Failed to add %s %s %s to DNS server!\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
fi
# Create SSL cert
if "${LIB_DIR}/ssl_peer_add" "${hostname}" "${username}" "IP:${ipv4},IP:${ipv6}"
then printf 'Successfully signed SSL certs for %s,%s,%s.\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
then printf 'Successfully signed SSL certs for %s\n' "${domain}" >>"${LOGFILE}"
else printf 'ERROR! Failed to create certs for %s with IPS: %s %s!\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
fi