# $Id$ provide basic-init sysvinit require basic-system set_system_service() { local command="$1" local service="$2" local opts="$3" [[ -z ${command} ]] && help_system_service && return 1 [[ -z ${service} ]] && help_system_service && return 1 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 case "${command}" in start) @@SYSVRCDDIR@@/"${service}" start ;; stop) @@SYSVRCDDIR@@/"${service}" stop ;; restart) @@SYSVRCDDIR@@/"${service}" restart ;; reload) @@SYSVRCDDIR@@/"${service}" reload ;; enable) rc-config add "${service}" ;; disable) rc-config del "${service}" ;; *) help_system_service && return ;; esac } get_system_service() { local command="$1" local service="$2" [[ -z ${command} ]] && help_system_service && return 1 [[ -z ${service} ]] && help_system_service && return 1 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 case "${command}" in status) @@SYSVRCDDIR@@/"${service}" status ;; enabled) rc-config show "${service}" ;; runlevel) eecho "function on todo" ;; *) help_system_service && return ;; esac }