Browse Source

Fix service problem with only credentials

Julien VAUBOURG 10 years ago
parent
commit
dee4de7dce
1 changed files with 2 additions and 2 deletions
  1. 2 2
      conf/init_ynh-vpnclient

+ 2 - 2
conf/init_ynh-vpnclient

@@ -154,8 +154,8 @@ if [[ ! "${1}" =~ stop ]]; then
     exit 1
     exit 1
   fi
   fi
 
 
-  find /etc/openvpn/keys/ -empty -name credentials &> /dev/null
+  empty=$(find /etc/openvpn/keys/ -empty -name credentials &> /dev/null | wc -l)
-  if [ $? -eq 0 -a ! -e /etc/openvpn/keys/user.key ]; then
+  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
     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
     exit 1
   fi
   fi