Parcourir la source

Fix service problem with only credentials

Julien VAUBOURG il y a 10 ans
Parent
commit
dee4de7dce
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      conf/init_ynh-vpnclient

+ 2 - 2
conf/init_ynh-vpnclient

@@ -154,8 +154,8 @@ if [[ ! "${1}" =~ stop ]]; then
     exit 1
   fi
 
-  find /etc/openvpn/keys/ -empty -name credentials &> /dev/null
-  if [ $? -eq 0 -a ! -e /etc/openvpn/keys/user.key ]; then
+  empty=$(find /etc/openvpn/keys/ -empty -name credentials &> /dev/null | wc -l)
+  if [ "${empty}" -gt 0 -a ! -e /etc/openvpn/keys/user.key ]; then
     echo "DISABLED SERVICE: You need either a client certificate, either a username, or both (you can add one through the web admin)" >&2
     exit 1
   fi