Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/sysvinit/sysvinit.client.class.in

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

revision 2269 by niro, Tue Jan 14 10:34:57 2014 UTC revision 2647 by niro, Tue Nov 10 14:41:14 2015 UTC
# Line 12  set_system_service() Line 12  set_system_service()
12   [[ -z ${command} ]] && help_system_service && return 1   [[ -z ${command} ]] && help_system_service && return 1
13   [[ -z ${service} ]] && help_system_service && return 1   [[ -z ${service} ]] && help_system_service && return 1
14    
  if [[ ! -x ${MROOT}@@SYSVRCDDIR@@/${service} ]]  
  then  
  eecho "Service '${service}' unknown!"  
  return 1  
  fi  
   
  if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]  
  then  
  case "${command}" in  
  start|stop|restart|reload)  
  eecho "Command not available while \$MROOT is set"  
  return 1  
  ;;  
  esac  
  fi  
   
15   case "${command}" in   case "${command}" in
16   start) @@SYSVRCDDIR@@/"${service}" start ;;   start) mcore-system-service start "${service}" ;;
17   stop) @@SYSVRCDDIR@@/"${service}" stop ;;   stop) mcore-system-service stop "${service}" ;;
18   restart) @@SYSVRCDDIR@@/"${service}" restart ;;   restart) mcore-system-service restart "${service}" ;;
19   reload) @@SYSVRCDDIR@@/"${service}" reload ;;   reload) mcore-system-service reload "${service}" ;;
20   enable) rc-config add "${service}" ;;   enable) mcore-system-service enable "${service}" ;;
21   disable) rc-config del "${service}" ;;   disable) mcore-system-service disable "${service}" ;;
22   *) help_system_service && return ;;   *) help_system_service && return 1 ;;
23   esac   esac
24  }  }
25    
# Line 47  get_system_service() Line 31  get_system_service()
31   [[ -z ${command} ]] && help_system_service && return 1   [[ -z ${command} ]] && help_system_service && return 1
32   [[ -z ${service} ]] && help_system_service && return 1   [[ -z ${service} ]] && help_system_service && return 1
33    
  if [[ ! -x ${MROOT}@@SYSVRCDDIR@@/${service} ]]  
  then  
  eecho "Service '${service}' unknown!"  
  return 1  
  fi  
   
  if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]]  
  then  
  case "${command}" in  
  status)  
  eecho "Command not available while \$MROOT is set"  
  return 1  
  ;;  
  esac  
  fi  
   
34   case "${command}" in   case "${command}" in
35   status) @@SYSVRCDDIR@@/"${service}" status ;;   status) mcore-system-service status "${service}" status ;;
36   enabled) rc-config show "${service}" ;;   enabled) mcore-system-service enabled "${service}" ;;
37   runlevel) eecho "function on todo" ;;   runlevel) mcore-system-service runlevel ;;
38   *) help_system_service && return ;;   *) help_system_service && return 1 ;;
39   esac   esac
40  }  }

Legend:
Removed from v.2269  
changed lines
  Added in v.2647