Add enabled and disabled user exits

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-07-29 15:15:57 -07:00
parent 5a24953e6c
commit 80e6cd8a2f
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 10 additions and 3 deletions

View File

@ -109,7 +109,7 @@ sub generate_script_1( $ ) {
################################################################################
EOF
for my $exit ( qw/init start tcclear started stop stopped clear refresh refreshed restored/ ) {
for my $exit ( qw/init start tcclear started stop stopped clear refresh refreshed restored enabled disabled/ ) {
emit "\nrun_${exit}_exit() {";
push_indent;
append_file $exit or emit 'true';

View File

@ -1088,7 +1088,11 @@ CEOF
emit( "setup_${dev}_tc" ) if $tcdevices->{$interface};
}
emit( qq(rm -f \${VARDIR}/${physical}_disabled) );
emit( qq(rm -f \${VARDIR}/${physical}_disabled),
'',
'run_enabled_exit'
);
emit_started_message( '', 2, $pseudo, $table, $number );
if ( get_interface_option( $interface, 'used_address_variable' ) || get_interface_option( $interface, 'used_gateway_variable' ) ) {
@ -1233,7 +1237,10 @@ CEOF
"qt \$TC qdisc del dev $physical ingress\n" ) if $tcdevices->{$interface};
}
emit( "echo 1 > \${VARDIR}/${physical}.status" );
emit( "echo 1 > \${VARDIR}/${physical}.status",
'',
'run_disabled_exit'
);
if ( $pseudo ) {
emit( "progress_message2 \" Optional Interface $table stopped\"" );