(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PIDDIR='> name:PIDDIR) op: assign_op.Equal rhs: {<'/var/run/samba'>} spids: [36] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SMBDPID='> name:SMBDPID) op: assign_op.Equal rhs: {($ Id.VSub_DollarName PIDDIR) <'/smbd.pid'>} spids: [39] ) ] redirects: [] ) (C {<unset>} {<TMPDIR>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<test>} {<-x>} {<'/usr/sbin/smbd'>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) (C {<.>} {<'/lib/lsb/init-functions'>}) (command.Case to_match: {($ Id.VSub_Number 1)} arms: [ (case_arm pat_list: [{<start>}] action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<init_is_upstart>}) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})] spids: [84 89] ) ] else_action: [] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'SERVER_ROLE='> name:SERVER_ROLE) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> child: (command.Pipeline children: [ (command.Simple words: [ {<samba-tool>} {<testparm>} {<--parameter-name> <Id.Lit_Equals '='> (DQ <'server role'>)} ] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) (C {<tail>} {<-1>}) ] negated: F stderr_indices: [] ) right: <Id.Backtick_Right '`'> ) } spids: [100] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName SERVER_ROLE))} {<Id.Lit_Equals '='>} {(DQ <'active directory domain controller'>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [125 142] ) ] else_action: [] redirects: [] ) (C {<log_daemon_msg>} {(DQ <'Starting SMB/CIFS daemon'>)} {<smbd>}) (C {<install>} {<-o>} {<root>} {<-g>} {<root>} {<-m>} {<755>} {<-d>} {($ Id.VSub_DollarName PIDDIR)} ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.Pipeline children: [ (C {<start-stop-daemon>} {<--start>} {<--quiet>} {<--oknodo>} {<--exec>} {<'/usr/sbin/smbd'>} {<-->} {<-D>} ) ] negated: T stderr_indices: [] ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<log_end_msg>} {<1>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [187 208] ) ] else_action: [] redirects: [] ) (C {<log_end_msg>} {<0>}) ] spids: [80 81 230 -1] ) (case_arm pat_list: [{<stop>}] action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<init_is_upstart>}) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})] spids: [237 242] ) ] else_action: [] redirects: [] ) (C {<log_daemon_msg>} {(DQ <'Stopping SMB/CIFS daemon'>)} {<smbd>}) (C {<start-stop-daemon>} {<--stop>} {<--quiet>} {<--pidfile>} {($ Id.VSub_DollarName SMBDPID)}) (C {<sleep>} {<1>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-f>} {($ Id.VSub_DollarName SMBDPID)} {<Id.Lit_RBracket ']'>} ) (command.Pipeline children: [ (command.Simple words: [ {<ps>} {<h>} { (command_sub left_token: <Id.Left_Backtick '`'> child: (C {<cat>} {($ Id.VSub_DollarName SMBDPID)}) right: <Id.Backtick_Right '`'> ) } ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] negated: T stderr_indices: [] ) ] ) ] ) action: [(C {<rm>} {<-f>} {($ Id.VSub_DollarName SMBDPID)})] spids: [284 315] ) ] else_action: [] redirects: [] ) (C {<log_end_msg>} {<0>}) ] spids: [233 234 343 -1] ) (case_arm pat_list: [{<reload>}] action: [ (C {<log_daemon_msg>} {(DQ <'Reloading /etc/samba/smb.conf'>)} {<smbd>}) (C {<start-stop-daemon>} {<--stop>} {<--quiet>} {<--signal>} {<HUP>} {<--pidfile>} {($ Id.VSub_DollarName SMBDPID)} ) (C {<log_end_msg>} {<0>}) ] spids: [346 347 381 -1] ) (case_arm pat_list: [{<restart>} {<force-reload>}] action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<init_is_upstart>}) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})] spids: [390 395] ) ] else_action: [] redirects: [] ) (C {($ Id.VSub_Number 0)} {<stop>}) (C {<sleep>} {<1>}) (C {($ Id.VSub_Number 0)} {<start>}) ] spids: [384 387 421 -1] ) (case_arm pat_list: [{<status>}] action: [ (C {<status_of_proc>} {<-p>} {($ Id.VSub_DollarName SMBDPID)} {<'/usr/sbin/smbd'>} {<smbd>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {($ Id.VSub_QMark '?')} ) ] spids: [424 425 444 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<echo>} {(DQ <'Usage: /etc/init.d/smbd {start|stop|reload|restart|force-reload|status}'>)} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [447 448 463 -1] ) ] redirects: [] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )