diff options
Diffstat (limited to 'lib/Vyatta/IpTables/IpSet.pm')
-rwxr-xr-x | lib/Vyatta/IpTables/IpSet.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Vyatta/IpTables/IpSet.pm b/lib/Vyatta/IpTables/IpSet.pm index 5c4b6ce..729c58e 100755 --- a/lib/Vyatta/IpTables/IpSet.pm +++ b/lib/Vyatta/IpTables/IpSet.pm @@ -55,6 +55,15 @@ my $logger = 'logger -t IpSet.pm -p local0.warn --'; my $addr_range_mask = 24; my $lockfile = "/opt/vyatta/config/.lock"; +# remove lock file to avoid commit blockade on interrupt +# like CTRL+C. +sub INT_handler { + my $rc = system("sudo rm -f $lockfile >>/dev/null"); + exit(0); +} + +$SIG{'INT'} = 'INT_handler'; + sub new { my ($that, $name, $type) = @_; |