$USER can be root or $PKIUSER
This commit is contained in:
parent
5f07a5e24c
commit
8e9d72071e
|
@ -398,13 +398,13 @@ check() {
|
|||
}
|
||||
|
||||
main() {
|
||||
[ "$(id -u)" -eq 0 ] || error "Please become root before running ${0} !"
|
||||
|
||||
# default config
|
||||
# TODO : override with /etc/default/shellpki
|
||||
CONFFILE="/etc/shellpki/openssl.cnf"
|
||||
PKIUSER="shellpki"
|
||||
|
||||
[ "${USER}" != "root" ] || [ "${USER}" != "${PKIUSER}" ] || error "Please become root before running ${0} !"
|
||||
|
||||
# retrieve CA path from config file
|
||||
CADIR=$(grep -E "^dir" "${CONFFILE}" | cut -d'=' -f2|xargs -n1)
|
||||
CAKEY=$(grep -E "^private_key" "${CONFFILE}" | cut -d'=' -f2|xargs -n1|sed "s~\$dir~${CADIR}~")
|
||||
|
|
Loading…
Reference in a new issue