(command.CommandList
  children: [
    (command.ShFunction
      name: enable
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<'/usr/sbin/svcadm'>} {<enable>} {<-t>} {($ Id.VSub_Number 1)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '?')} {<Id.Lit_Equals '='>} {<0>} 
                  {<Id.Lit_RBracket ']'>}
                )
                (C {<echo>} {(DQ <'ypstart: unable to enable '> ($ Id.VSub_Number 1))})
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_Backtick '`'>
                                    child: 
                                      (C {<'/usr/bin/svcprop'>} {<-p>} {<'restarter/state'>} 
                                        {($ Id.VSub_Number 1)}
                                      )
                                    right: <Id.Backtick_Right '`'>
                                  )
                                )
                              } {<Id.Lit_Equals '='>} {(DQ <maintenance>)} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {(DQ <'ypstart: unable to enable '> ($ Id.VSub_Number 1) <'; in maintenance'>)}
                    )
                  ]
                  spids: [123 150]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'domain='> name:domain)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: (C {<domainname>})
                right: <Id.Backtick_Right '`'>
              )
            }
          spids: [168]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName domain))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} 
              {(DQ <'ERROR: Default domain is not defined.  '> <Id.Lit_BadBackslash '\\'> <c>)}
            )
            (C {<echo>} 
              {
                (DQ <'Use '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') 
                  <domainname> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <' to set the domain.'>
                )
              }
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [175 188]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<echo>} {(DQ <'starting NIS (YP server) services:'> <Id.Lit_BadBackslash '\\'> <c>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'zone='> name:zone)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: (C {<'/sbin/zonename'>})
                right: <Id.Backtick_Right '`'>
              )
            }
          spids: [227]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {<-d>} {<'/var/yp/'> ($ Id.VSub_DollarName domain)} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'state='> name:state)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (C {<'/usr/bin/svcprop'>} {<-p>} {<'restarter/state'>} 
                            {<'network/nis/server'> <Id.Lit_Colon ':'> <default>}
                          )
                        right: <Id.Backtick_Right '`'>
                      )
                    }
                  spids: [250]
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName state))} {<Id.Lit_Equals '='>} 
                  {(DQ <disabled>)} {<Id.Lit_RBracket ']'>}
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {<-n>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_Backtick '`'>
                                        child: 
                                          (C {<pgrep>} {<-z>} {($ Id.VSub_DollarName zone)} {<ypserv>})
                                        right: <Id.Backtick_Right '`'>
                                      )
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      action: [(C {<echo>} {(DQ <'ypstart: ypserv already running?'>)})]
                      spids: [283 306]
                    )
                  ]
                  else_action: []
                  redirects: []
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<enable>} 
                  {<svc> <Id.Lit_Colon ':'> <'/network/nis/server'> <Id.Lit_Colon ':'> <default>}
                )
                (C {<echo>} {(DQ <' ypserv'> <Id.Lit_BadBackslash '\\'> <c>)})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'YP_SERVER='> name:YP_SERVER)
                  op: assign_op.Equal
                  rhs: {<TRUE>}
                  spids: [340]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-f>} {<'/var/yp/NISLDAPmapping'>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'passwdfile='> name:passwdfile)
                          op: assign_op.Equal
                          rhs: {<'/var/yp/'> ($ Id.VSub_DollarName domain) <'/LDAP_passwd.byname'>}
                          spids: [366]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [352 363]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'passwdfile='> name:passwdfile)
                      op: assign_op.Equal
                      rhs: {<'/var/yp/'> ($ Id.VSub_DollarName domain) <'/passwd.byname'>}
                      spids: [375]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'master='> name:master)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<'/usr/sbin/makedbm'>} {<-u>} {($ Id.VSub_DollarName passwdfile)})
                              (C {<grep>} {<YP_MASTER_NAME>})
                              (C {<nawk>} {(SQ <'{ print tolower($2) }'>)})
                            ]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Backtick_Right '`'>
                      )
                    }
                  spids: [384]
                )
              ]
              redirects: []
            )
          ]
          spids: [235 247]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'state='> name:state)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_Backtick '`'>
                child: 
                  (C {<'/usr/bin/svcprop'>} {<-p>} {<'restarter/state'>} 
                    {<'network/nis/client'> <Id.Lit_Colon ':'> <default>}
                  )
                right: <Id.Backtick_Right '`'>
              )
            }
          spids: [423]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName state))} {<Id.Lit_Equals '='>} 
          {(DQ <disabled>)} {<Id.Lit_RBracket ']'>}
        )
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-n>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: (C {<pgrep>} {<-z>} {($ Id.VSub_DollarName zone)} {<ypbind>})
                                right: <Id.Backtick_Right '`'>
                              )
                            )
                          } {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [(C {<echo>} {(DQ <'ypstart: ypbind already running?'>)})]
              spids: [455 478]
            )
          ]
          else_action: []
          redirects: []
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<enable>} {<svc> <Id.Lit_Colon ':'> <'/network/nis/client'> <Id.Lit_Colon ':'> <default>})
        (C {<echo>} {(DQ <' ypbind'> <Id.Lit_BadBackslash '\\'> <c>)})
      ]
    )
    (command.Simple
      words: [{<ypwhich>}]
      redirects: [
        (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>})
      ]
      more_env: []
      do_fork: T
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName YP_SERVER))} 
                      {<Id.Lit_Equals '='>} {<TRUE>} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'hostname='> name:hostname)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (command.Pipeline
                            children: [(C {<uname>} {<-n>}) (C {<tr>} {(SQ <'[A-Z]'>)} {(SQ <'[a-z]'>)})]
                            negated: F
                            stderr_indices: []
                          )
                        right: <Id.Backtick_Right '`'>
                      )
                    }
                  spids: [548]
                )
              ]
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName master))} 
                              {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName hostname))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<enable>} 
                          {<svc> <Id.Lit_Colon ':'> <'/network/nis/xfr'> <Id.Lit_Colon ':'> <default>}
                        )
                        (C {<echo>} {(DQ <' ypxfrd'> <Id.Lit_BadBackslash '\\'> <c>)})
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<enable>} 
                          {<svc> <Id.Lit_Colon ':'> <'/network/nis/passwd'> <Id.Lit_Colon ':'> <default>}
                        )
                        (C {<echo>} {(DQ <' rpc.yppasswdd'> <Id.Lit_BadBackslash '\\'> <c>)})
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-f>} 
                                      {<'/var/yp/NISLDAPmapping'>} {<-a>} {<-f>} {<'/var/yp/updaters'>} {<Id.Lit_RBracket ']'>}
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<enable>} 
                                  {<svc> <Id.Lit_Colon ':'> <'/network/nis/update'> <Id.Lit_Colon ':'> 
                                    <default>
                                  }
                                )
                                (C {<echo>} {(DQ <' rpc.ypupdated'> <Id.Lit_BadBackslash '\\'> <c>)})
                              ]
                            )
                          ]
                          spids: [631 650]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                  ]
                  spids: [571 588]
                )
              ]
              else_action: []
              redirects: []
            )
          ]
          spids: [522 537]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<'/usr/sbin/svcadm'>} {<restart>} {<'milestone/name-services'>})
    (C {<echo>} {(DQ <' done.'>)})
  ]
)