(command.CommandList children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {<'/etc/defaults/rc.conf'>} {<Id.Lit_RBracket ']'>}) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<.>} {<'/etc/defaults/rc.conf'>}) (C {<source_rc_confs>})] spids: [149 160] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {<'/etc/rc.conf'>} {<Id.Lit_RBracket ']'>}) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<.>} {<'/etc/rc.conf'>})] spids: [170 181] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:EDITOR) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name EDITOR> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonHyphen ':-'> arg_word: {<Id.Lit_Slash '/'> <usr> <Id.Lit_Slash '/'> <bin> <Id.Lit_Slash '/'> <vi>} ) ) } spids: [191] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PAGER) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name PAGER> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonHyphen ':-'> arg_word: {<Id.Lit_Slash '/'> <usr> <Id.Lit_Slash '/'> <bin> <Id.Lit_Slash '/'> <more>} ) ) } spids: [203] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tempfoo) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) } spids: [216] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:TMPFILE) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> child: (C {<mktemp>} {<-t>} {(${ Id.VSub_Name tempfoo)}) ) } spids: [225] ) ] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (command.ShFunction name: get_yes_no body: (BraceGroup children: [ (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands:[(C {<true>})]) body: (command.DoGroup children: [ (C {<echo>} {<-n>} {(DQ ($ Id.VSub_Number '$1') <' (Y/N) ? '>)}) (C {<read>} {<-t>} {<30>} {<a>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:a) op: assign_op.Equal rhs: {(DQ <No>)} spids: [297] ) ] ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token:<Id.ControlFlow_Return return>) terminator: <Id.Op_Semi _> ) ] spids: [280 294] ) ] ) (command.Case to_match: {($ Id.VSub_DollarName '$a')} arms: [ (case_arm pat_list: [{<Id.Lit_LBracket '['> <Yy> <Id.Lit_RBracket ']'>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:a) op: assign_op.Equal rhs: {(DQ <Yes>)} spids: [323] ) ] ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [318 321 331 -1] ) (case_arm pat_list: [{<Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'>}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:a) op: assign_op.Equal rhs: {(DQ <No>)} spids: [339] ) ] ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token: <Id.ControlFlow_Return return> ) ] spids: [334 337 347 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] spids: [350 351 352 -1] ) ] ) ] ) ) ] ) ) (command.ShFunction name: restore_rules body: (BraceGroup children: [ (command.Simple words: [{<nohup>} {<sh>} {(${ Id.VSub_Name firewall_script)}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) (redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>}) ] do_fork: T ) (C {<rm>} {(${ Id.VSub_Name TMPFILE)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) ) (command.Case to_match: {(DQ (${ Id.VSub_Name firewall_type))} arms: [ (case_arm pat_list: [ {<Id.Lit_LBracket '['> <Cc> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ll> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ii> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ee> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Tt> <Id.Lit_RBracket ']'> } {<Id.Lit_LBracket '['> <Cc> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ll> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Oo> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ss> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ee> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Dd> <Id.Lit_RBracket ']'> } {<Id.Lit_LBracket '['> <Oo> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Pp> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ee> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'> } {<Id.Lit_LBracket '['> <Ss> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ii> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Mm> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Pp> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ll> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ee> <Id.Lit_RBracket ']'> } {<Id.Lit_LBracket '['> <Uu> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Kk> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Oo> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Ww> <Id.Lit_RBracket ']'> <Id.Lit_LBracket '['> <Nn> <Id.Lit_RBracket ']'> } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:edit_file) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name firewall_script))} spids: [510] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rules_edit) op: assign_op.Equal rhs: {<no>} spids: [518] ) ] ) ] spids: [412 507 522 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-r>} {(DQ (${ Id.VSub_Name firewall_type))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:edit_file) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name firewall_type))} spids: [546] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rules_edit) op: assign_op.Equal rhs: {<yes>} spids: [554] ) ] ) ] spids: [528 543] ) ] ) ] spids: [524 525 561 -1] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-f>} {(${ Id.VSub_Name edit_file) <.new>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<get_yes_no>} {(DQ <'A new rules file already exists, do you want to use it'>)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$a')} {<Id.Lit_Equals '='>} {(SQ <No>)} {<Id.Lit_RBracket ']'>} ) (C {<cp>} {(${ Id.VSub_Name edit_file)} {(${ Id.VSub_Name edit_file) <.new>}) ] ) ] spids: [566 580] ) ] else_action: [(C {<cp>} {(${ Id.VSub_Name edit_file)} {(${ Id.VSub_Name edit_file) <.new>})] ) (C {<trap>} {<restore_rules>} {<SIGHUP>}) (C {(${ Id.VSub_Name EDITOR)} {(${ Id.VSub_Name edit_file) <.new>}) (C {<get_yes_no>} {(DQ <'Do you want to install the new rules'>)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$a')} {<Id.Lit_Equals '='>} {(SQ <No>)} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<Id.KW_Bang '!'>} here_end_span_id: 687 stdin_parts: [ <'The rules will be changed now. If the message \'Type y to keep the new\n'> <'rules\' does not appear on the screen or the y key is not pressed in 30\n'> <'seconds, the original rules will be restored.\n'> <'The TCP/IP connections might be broken during the change. If so, restore\n'> <'the ssh/telnet connection being used.\n'> ] ) ) ] do_fork: T ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name rules_edit)} {<Id.Lit_Equals '='>} {<yes>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<nohup>} {<sh>} {(${ Id.VSub_Name firewall_script)} {(${ Id.VSub_Name firewall_type) <.new>} ] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(${ Id.VSub_Name TMPFILE)} ) (redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>}) ] do_fork: T ) ] spids: [689 704] ) ] else_action: [ (command.Simple words: [{<nohup>} {<sh>} {(${ Id.VSub_Name firewall_script) <.new>}] redirects: [ (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<'/dev/null'>}) (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(${ Id.VSub_Name TMPFILE)} ) (redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>}) ] do_fork: T ) ] ) (command.Sentence child:(C {<sleep>} {<2>}) terminator:<Id.Op_Semi _>) (C {<get_yes_no>} {(DQ <'Would you like to see the resulting new rules'>)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$a')} {<Id.Lit_Equals '='>} {(SQ <Yes>)} {<Id.Lit_RBracket ']'>} ) (C {(${ Id.VSub_Name PAGER)} {(${ Id.VSub_Name TMPFILE)}) ] ) (C {<get_yes_no>} {(DQ <'Type y to keep the new rules'>)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$a')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(SQ <Yes>)} {<Id.Lit_RBracket ']'>} ) (C {<restore_rules>}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DATE) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<date>} {(DQ <'+%Y%m%d%H%M'>)}))} spids: [821] ) ] ) (C {<cp>} {(${ Id.VSub_Name edit_file)} {(${ Id.VSub_Name edit_file) <.> ($ Id.VSub_DollarName '$DATE')} ) (C {<mv>} {(${ Id.VSub_Name edit_file) <.new>} {(${ Id.VSub_Name edit_file)}) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<Id.KW_Bang '!'>} here_end_span_id: 870 stdin_parts: [ <'The new rules are now installed. The previous rules have been preserved in\n'> <'the file '> (${ Id.VSub_Name edit_file) <.> ($ Id.VSub_DollarName '$DATE') <'\n'> ] ) ) ] do_fork: T ) (command.Pipeline children: [ (C {<diff>} {<-F>} {(DQ <'^# .*[A-Za-z]'>)} {<-u>} {(${ Id.VSub_Name edit_file) <.> ($ Id.VSub_DollarName '$DATE')} {(${ Id.VSub_Name edit_file)} ) (C {<mail>} {<-s>} { (DQ (command_sub left_token:<Id.Left_Backtick '`'> child:(C {<hostname>})) <' Firewall rule change'> ) } {<root>} ) ] negated: F ) (C {<rm>} {(${ Id.VSub_Name TMPFILE)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )