Changeset 65fd04b2


Ignore:
Timestamp:
08/22/13 12:17:32 (11 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
197bdbf
Parents:
629cca35
Message:

Add rc_halt() to our SH functions, remove it from pc-updatemanager

Location:
src-sh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    re5a54a6 r65fd04b2  
    638638  fi 
    639639} 
     640 
     641# Run-command, don't halt if command exits with non-0 
     642rc_nohalt() 
     643{ 
     644  CMD="$1" 
     645 
     646  if [ -z "${CMD}" ] ; then 
     647    exit_err "Error: missing argument in rc_nohalt()" 
     648  fi 
     649 
     650  ${CMD} 
     651} 
     652 
     653# Run-command, halt if command exits with non-0 
     654rc_halt() 
     655{ 
     656  CMD="$@" 
     657 
     658  if [ -z "${CMD}" ] ; then 
     659    exit_err "Error: missing argument in rc_halt()" 
     660  fi 
     661 
     662  ${CMD} 
     663  STATUS=$? 
     664  if [ ${STATUS} -ne 0 ] ; then 
     665    exit_err "Error ${STATUS}: ${CMD}" 
     666  fi 
     667} 
  • src-sh/pc-updatemanager/pc-updatemanager

    rf967699 r65fd04b2  
    7777 
    7878        exit 1 
    79 } 
    80  
    81 # Run-command, don't halt if command exits with non-0 
    82 rc_nohalt() 
    83 { 
    84   CMD="$1" 
    85   
    86   if [ -z "${CMD}" ] ; then 
    87     exit_err "Error: missing argument in rc_nohalt()" 
    88   fi 
    89  
    90   ${CMD} 
    91 } 
    92  
    93 # Run-command, halt if command exits with non-0 
    94 rc_halt() 
    95 { 
    96   CMD="$@" 
    97  
    98   if [ -z "${CMD}" ] ; then 
    99     exit_err "Error: missing argument in rc_halt()" 
    100   fi 
    101  
    102   ${CMD} 
    103   STATUS=$? 
    104   if [ ${STATUS} -ne 0 ] ; then 
    105     exit_err "Error ${STATUS}: ${CMD}" 
    106   fi 
    10779} 
    10880 
Note: See TracChangeset for help on using the changeset viewer.