diff options
Diffstat (limited to 'src/nopsysstated')
-rwxr-xr-x | src/nopsysstated | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nopsysstated b/src/nopsysstated index f1a05f8..dc43c99 100755 --- a/src/nopsysstated +++ b/src/nopsysstated @@ -25,18 +25,18 @@ -- the arguments should be: now# nowlen next# nextlen -- -require "socket" +socket = require "socket" package.path = package.path .. ";_rhnoplibdir_/?.lua" db = require "db" - -conffile = "nopsysstated.conf" conf = require "conf" -db = assert(db.init(conf.db_db, conf.db_user, conf.db_pwd, conf.db_host, conf.db_port, conf.db_table)) +local cnf = conf.load("nopsysstated.conf") + +db = assert(db.init(cnf.db_db, cnf.db_user, cnf.db_pwd, cnf.db_host, cnf.db_port, cnf.db_table)) local sock = assert(socket.tcp()) -local ret, err = sock:connect(conf.host, conf.port) +local ret, err = sock:connect(cnf.host, cnf.port) if ret == nil then print(err) return 1 |