wagon/back/lib/ssl_peer_del

13 lines
400 B
Plaintext
Raw Normal View History

2022-08-29 01:04:37 -06:00
#!/bin/bash
# FILE: wagon:back/lib/ssl/peer/del
2022-08-29 01:04:37 -06:00
# DESCRIPTION: Delete SSL cert for a removed device
# USAGE: del hostname username
2022-08-29 01:04:37 -06:00
source /etc/wagon/config
hostname="${1}"; username="${2}"
2022-09-10 16:38:11 -06:00
if ! sudo rm -rf "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/" 2>/dev/null; then
printf 'ERROR! %s failed to delete %s!\n' "${0}" "${SSL_CONFIG_DIR}/${username}/${hostname}/" >&2
exit 1
2022-09-10 16:38:11 -06:00
fi