From ffa273ef8dc4a712666313097c3dadbdc9caffa3 Mon Sep 17 00:00:00 2001 From: thefosk Date: Fri, 3 Apr 2015 20:31:58 -0700 Subject: [PATCH] Better way of handling #111 --- src/cli/utils/start.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/utils/start.lua b/src/cli/utils/start.lua index aebe665ca2f..eab119e20d4 100644 --- a/src/cli/utils/start.lua +++ b/src/cli/utils/start.lua @@ -39,7 +39,8 @@ end local function prepare_nginx_working_dir(kong_config) if kong_config.send_anonymous_reports then -- If there is no internet connection, disable this feature - if os.execute("dig +time=2 +tries=2 "..KONG_SYSLOG.. "> /dev/null") == 0 then + local socket = require "socket" + if socket.dns.toip(KONG_SYSLOG) then kong_config.nginx = "error_log syslog:server="..KONG_SYSLOG..":61828 error;\n"..kong_config.nginx else cutils.logger:warn("The internet connection might not be available, cannot resolve "..KONG_SYSLOG)