diff options
Diffstat (limited to 'vlc-model.lua')
-rw-r--r-- | vlc-model.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/vlc-model.lua b/vlc-model.lua index aa9470f..e210e25 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -1,4 +1,4 @@ -module(..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -11,7 +11,7 @@ local processname="vlc" local configfile = "/etc/conf.d/"..tostring(processname) local logfile = "/var/log/vlc/vlc.log" -function set_processname(p) +function mymodule.set_processname(p) processname = p configfile = "/etc/conf.d/"..tostring(processname) end @@ -24,24 +24,24 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function get_startstop(self, clientdata) +function mymodule.get_startstop(self, clientdata) return modelfunctions.get_startstop(processname) end -function startstop_service(self, startstop, action) +function mymodule.startstop_service(self, startstop, action) return modelfunctions.startstop_service(startstop, action) end -function getstatus() +function mymodule.getstatus() return modelfunctions.getstatus(processname, packagename, tostring(processname).." Status") end -function getconfigfile() +function mymodule.getconfigfile() -- FIXME Validate return modelfunctions.getfiledetails(configfile) end -function get_filedetails() +function mymodule.get_filedetails() local path=logfile local path2 if fs.is_file(configfile) then @@ -53,12 +53,13 @@ function get_filedetails() return modelfunctions.getfiledetails(path) end -function setconfigfile(self, filedetails) +function mymodule.setconfigfile(self, filedetails) -- FIXME Validate return modelfunctions.setfiledetails(self, filedetails, {configfile}) end -function getleases() +function mymodule.getleases() return modelfunctions.getfiledetails(leasefile) end +return mymodule |