check_openvpn_certificates.sh : fix conf_file var definition

Sometimes, OpenVPN run multiples processes
This commit is contained in:
Jérémy Dubois 2021-06-10 16:15:35 +02:00
parent 59c8b9b62f
commit 3fc1dabec4
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ _30_days="2592000"
current_date=$($date_cmd +"%s")
# Trying to define the OpenVPN conf file location - default to /etc/openvpn/server.conf
conf_file=$(ps auwwwx | grep openvpn | grep -- --config | grep -v sed | sed -e "s/.*config \(\/etc\/openvpn.*.conf\).*/\1/")
conf_file=$(ps auwwwx | grep openvpn | grep -- --config | grep -v sed | sed -e "s/.*config \(\/etc\/openvpn.*.conf\).*/\1/" | head -1)
[ "$SYSTEM" = "openbsd" ] && conf_file=${conf_file:-$(grep openvpn_flags /etc/rc.conf.local | sed -e "s/.*config \(\/etc\/openvpn.*.conf\).*/\1/")}
conf_file=${conf_file:-"/etc/openvpn/server.conf"}