/[baselayout]/branches/rc-scripts-1_6/sbin/runscript.sh
Gentoo

Diff of /branches/rc-scripts-1_6/sbin/runscript.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1080 Revision 1081
325 # The basic idea here is to have some sort of consistent 325 # The basic idea here is to have some sort of consistent
326 # output in the status() function which scripts can use 326 # output in the status() function which scripts can use
327 # as an generic means to detect status. Any other output 327 # as an generic means to detect status. Any other output
328 # should thus be formatted in the custom status() function 328 # should thus be formatted in the custom status() function
329 # to work with the printed " * status: foo". 329 # to work with the printed " * status: foo".
330 local efunc="" state=""
330 331
331 if service_started "${myservice}" ; then 332 if service_started "${myservice}" ; then
332 if [[ ${RC_QUIET_STDOUT} != "yes" ]] ; then 333 efunc="einfo"
333 einfo "status: started" 334 state="started"
334 else
335 return 0
336 fi
337 else 335 else
336 efunc="eerror"
337 state="stopped"
338 fi
338 if [[ ${RC_QUIET_STDOUT} != "yes" ]] ; then 339 [[ ${RC_QUIET_STDOUT} != "yes" ]] \
339 eerror "status: stopped" 340 && ${efunc} "status: ${state}"
340 else
341 return 1
342 fi
343 fi
344 341
345 status 342 status
343 [[ ${efunc} != "eerror" ]]
346} 344}
347 345
348rcscript_errors=$(wrap_rcscript "${myscript}" 2>&1) || { 346rcscript_errors=$(wrap_rcscript "${myscript}" 2>&1) || {
349 [[ -n ${rcscript_errors} ]] && echo "${rcscript_errors}" >&2 347 [[ -n ${rcscript_errors} ]] && echo "${rcscript_errors}" >&2
350 eerror "ERROR: \"${myscript}\" has syntax errors in it; not executing..." 348 eerror "ERROR: \"${myscript}\" has syntax errors in it; not executing..."

Legend:
Removed from v.1080  
changed lines
  Added in v.1081

  ViewVC Help
Powered by ViewVC 1.1.20