Skip to content

Commit 0b2e632

Browse files
Oestlekylemanna
authored andcommitted
remove remove_files function and second arg
1 parent df80ea5 commit 0b2e632

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

bin/ovpn_revokeclient

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ if [ -z "$EASYRSA_PKI" ]; then
2222
fi
2323

2424
cn="$1"
25-
parm="$2"
2625

2726
if [ ! -f "$EASYRSA_PKI/private/${cn}.key" ]; then
2827
echo "Unable to find \"${cn}\", please try again or generate the key first" >&2
@@ -37,25 +36,4 @@ revoke_client_certificate(){
3736
chmod 644 "$OPENVPN/crl.pem"
3837
}
3938

40-
remove_files(){
41-
rm -v "$EASYRSA_PKI/issued/${1}.crt"
42-
rm -v "$EASYRSA_PKI/private/${1}.key"
43-
rm -v "$EASYRSA_PKI/reqs/${1}.req"
44-
}
45-
46-
case "$parm" in
47-
"remove")
48-
revoke_client_certificate "$cn"
49-
remove_files "$cn"
50-
;;
51-
"" | "keep")
52-
revoke_client_certificate "$cn"
53-
;;
54-
*)
55-
echo "When revoking a client certificate, this script let you choose if you want to remove the corresponding crt, key and req files." >&2
56-
echo "Pease note that the removal of those files is required if you want to generate a new client certificate using the revoked certificate's CN." >&2
57-
echo " 1. keep (default): Keep the files." >&2
58-
echo " 2. remove: Remove the files." >&2
59-
echo "Please specify one of those options as second parameter." >&2
60-
;;
61-
esac
39+
revoke_client_certificate "$cn"

0 commit comments

Comments
 (0)