check if file exits before write it

main
mckaygerhard 2022-02-14 14:59:51 -04:00
parent 7cfe7d928d
commit 48737b82a1
1 changed files with 1 additions and 1 deletions

View File

@ -486,10 +486,10 @@ function AuthFilter( path, name, debug )
local file = io.open( path .. "/" .. name, "r" )
if not file then
file = io.open( path .. "/" .. name, "w+")
file:write("pass now")
if not file then
error( "The specified ruleset file does not exist." )
end
file:write("pass now")
file:close( file )
file = io.open( path .. "/" .. name, "r" )
end