(CommandList children: [ (FuncDef name: fail body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [61 65] ) (': ') ($ VSub_At '$@') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[70])] ) (C {(exit)} {(1)}) ] spids: [55] ) spids: [51 54] ) (FuncDef name: wipe_account body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(LhsName name:account) op:Equal spids:[105]) (assign_pair lhs:(LhsName name:basedn) op:Equal spids:[107]) ] spids: [103] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:account) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [111] ) ] spids: [111] ) (SimpleCommand words: [ {(echo)} { (DQ ('wiping account ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$account') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' ... ') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[127])] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:basedn) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(sdc-ldap)} {(search)} {(Lit_VarLike 'login=') (DQ ($ VSub_Name '$account'))} ) (C {(awk)} {(-F) (Lit_Other ':')} {(SQ <'$1 == "dn"{ print $2 }'>)}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [134 156] ) ) } spids: [132] ) ] spids: [132] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id:BoolUnary_z child:{(DQ ($ VSub_Name '$basedn'))}) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ (' note: account ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ($ VSub_Name '$account') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' does not exist.') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[186])] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [-1 173] ) ] spids: [-1 195] ) (Pipeline children: [ (C {(list_children)} {(DQ ($ VSub_Name '$basedn'))} {(DQ ('objectclass=sdcaccountrole'))}) (While cond: [(Sentence child:(C {(read)} {(basedn)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [(C {(delete_object)} {(DQ ($ VSub_Name '$basedn'))})] spids: [220 230] ) ) ] negated: False ) (Pipeline children: [ (C {(list_children)} {(DQ ($ VSub_Name '$basedn'))} {(DQ ('objectclass=sdcaccountpolicy'))} ) (While cond: [(Sentence child:(C {(read)} {(basedn)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [(C {(delete_object)} {(DQ ($ VSub_Name '$basedn'))})] spids: [255 265] ) ) ] negated: False ) (Pipeline children: [ (C {(list_children)} {(DQ ($ VSub_Name '$basedn'))} {(DQ ('objectclass=sdcaccountuser'))}) (While cond: [(Sentence child:(C {(read)} {(basedn)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [(C {(wipe_user)} {(DQ ($ VSub_Name '$basedn'))})] spids: [290 300] ) ) ] negated: False ) (C {(wipe_user)} {(DQ ($ VSub_Name '$basedn'))}) ] spids: [100] ) spids: [96 99] ) (FuncDef name: list_children body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs:(LhsName name:basedn) op:Equal spids:[334]) (assign_pair lhs:(LhsName name:filter) op:Equal spids:[336]) ] spids: [332] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:basedn) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [340] ) ] spids: [340] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filter) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [346] ) ] spids: [346] ) (Pipeline children: [ (C {(sdc-ldap)} {(search)} {(-b)} {(DQ ($ VSub_Name '$basedn'))} {(DQ ($ VSub_Name '$filter'))} ) (C {(awk)} {(SQ <'/^dn:/{ $1 = ""; print $0 }'>)}) ] negated: False ) ] spids: [329] ) spids: [325 328] ) (FuncDef name: wipe_user body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:basedn) op:Equal spids:[401])] spids: [399] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:basedn) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [405] ) ] spids: [405] ) (Pipeline children: [ (C {(list_children)} {(DQ ($ VSub_Name '$basedn'))} {(DQ ('objectclass=sdckey'))}) (While cond: [(Sentence child:(C {(read)} {(basedn)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [(C {(delete_object)} {(DQ ($ VSub_Name '$basedn'))})] spids: [433 443] ) ) ] negated: False ) (C {(delete_object)} {(DQ ($ VSub_Name '$basedn'))}) ] spids: [396] ) spids: [392 395] ) (FuncDef name: delete_object body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$mt_force')} right: {(DQ (true))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ (' delete: ') ($ VSub_Number '$1'))}) (C {(sdc-ldap)} {(delete)} {(DQ ($ VSub_Number '$1'))}) ] spids: [-1 490] ) ] else_action: [(C {(echo)} {(DQ (' found: ') ($ VSub_Number '$1'))})] spids: [510 521] ) ] spids: [472] ) spids: [468 471] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mt_accounts) op: Equal rhs: {(DQ ('marlin_test marlin_test_user_xacct marlin_test_authzA'))} spids: [539] ) ] spids: [539] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mt_accounts) op: Equal rhs: {(DQ ($ VSub_Name '$mt_accounts') (' marlin_test_authzB'))} spids: [544] ) ] spids: [544] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:mt_force) op:Equal rhs:{(DQ (false))} spids:[554])] spids: [554] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ ($ VSub_Number '$1'))} right: {(DQ (-f))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mt_force) op: Equal rhs: {(DQ (true))} spids: [583] ) ] spids: [583] ) ] spids: [-1 580] ) ] spids: [-1 588] ) (AndOr children: [ (SimpleCommand words: [{(which)} {(sdc-ldap)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[610]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[614]) ] ) (C {(fail)} {(DQ ('sdc-ldap not found (try running in global zone?)'))}) ] op_id: Op_DPipe ) (ForEach iter_name: account iter_words: [{($ VSub_Name '$mt_accounts')}] do_arg_iter: False body: (DoGroup children:[(C {(wipe_account)} {(DQ ($ VSub_Name '$account'))})] spids:[637646]) spids: [633 635] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name '$mt_force'))} right: {(DQ (false))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [672 676] ) (': use -f to remove entries.') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[680])] ) ] spids: [-1 666] ) ] spids: [-1 683] ) ] )