wagon/back/lib/ssl_peer_del

13 lines
378 B
Bash
Executable File

#!/bin/bash
# FILE: wgapi:back/lib/ssl/peer/del
# DESCRIPTION: Delete SSL cert for a removed device
# USAGE: del hostname username
# ERRORS:
# 3: Bad usage
# 4: Not root
[ ${#} -eq 2 ] || exit 3
(( EUID == 0 )) || exit 4
rm -rf "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/" 2>/dev/null
rm -rf "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}.*" 2>/dev/null