diff --git a/admin/Evoauth.pl b/admin/Evoauth.pl index 60b8eb3..85a914f 100644 --- a/admin/Evoauth.pl +++ b/admin/Evoauth.pl @@ -14,6 +14,9 @@ use Evoauth::Iptables; $SIG{INT} = $SIG{TERM} = $SIG{KILL} = ""; +sysopen(LOCK, "/tmp/evoauth.lock", O_WRONLY|O_EXCL|O_CREAT) + or die "Le verouillage a chou."; + # choix des options my %options=(); getopts("icsrd:a:",\%options); @@ -46,13 +49,5 @@ sub Usage() { exit; } -BEGIN { - sysopen(LOCK, "/tmp/evoauth.lock", O_WRONLY|O_EXCL|O_CREAT, 0644) - or die "Verouillage en cours, sortie : $!"; - - flock(LOCK, 2); -} - -END { - close (LOCK); -} +close LOCK; +unlink "/tmp/evoauth.lock";