diff options
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r-- | tinydns-model.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua index 7ac2495..29513ab 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -734,3 +734,17 @@ function createconfigfile (self, path) end return false, "Something went wrong!" end +function remove_file(self, path) + if not (fs.is_file(path)) then + return false,"File doesn't exist!" + end + if (validfilename(path)) then + local cmd, errors = io.popen( "/bin/rm " .. path, r ) + local cmdoutput = cmd:read("*a") + cmd:close() + return true, cmdoutput + else + return false, "Not a valid filename!" + end + return false, "Something went wrong!" +end |