diff --git a/.gitignore b/.gitignore index 8b13789..4c49bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ - +.env diff --git a/70-vpn-keys b/70-vpn-keys index af6be92..4a14c9b 100755 --- a/70-vpn-keys +++ b/70-vpn-keys @@ -3,7 +3,7 @@ CONFIG_DIR=/etc/openvpn/ca echo "" echo "List of OVPN keys:" - mapfile -t keys < <(sudo cat ${CONFIG_DIR}/pki/index.txt |grep ^V | grep -v server | grep -oh /CN=[[:alnum:]]* | sed -e 's/\/CN=//g') + mapfile -t keys < <(sudo cat ${CONFIG_DIR}/pki/index.txt | sed -ne 's/^V.*CN=\(\W\)*/\1/p' | grep -v server) out="Name, Expires\n" for i in "${!keys[@]}"; do IFS=" " read name <<< ${keys[i]} diff --git a/README.md b/README.md index 302a13f..364b84f 100755 --- a/README.md +++ b/README.md @@ -37,5 +37,5 @@ sudo update-motd # Update 08.09.2021 * Added module for track Openvpn keys (i use easyrsa for generating keys) and active connections -#P.S. -*In folder with openvpn config (`/etc/openvpn/`) locating directory with Certifiration Autority. Some files reading directly from CA (`/etc/openvpn/ca/pki/`) \ No newline at end of file +# P.S. +* In folder with openvpn config (`/etc/openvpn/`) locating directory with Certifiration Autority. Some files reading directly from CA (`/etc/openvpn/ca/pki/`)