13 lines
400 B
Bash
Executable File
13 lines
400 B
Bash
Executable File
#!/bin/bash
|
|
# FILE: wagon:back/lib/ssl/peer/del
|
|
# DESCRIPTION: Delete SSL cert for a removed device
|
|
# USAGE: del hostname username
|
|
|
|
source /etc/wagon/config
|
|
hostname="${1}"; username="${2}"
|
|
|
|
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
|
|
fi
|