#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/mdadm-service-start-stop # # Creation: 2023-01-20 hbfl # Last Update: $Id$ # # Copyright (c) 2011-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- package_name='mdadm' # include eislib . /var/install/include/eislib . /etc/config.d/${package_name} #--------------------------------------------------------------------------- # start #--------------------------------------------------------------------------- mdadm_start() { /usr/sbin/service --msg="Start service" start mdmonitor.service mdmonitor-oneshot.timer if [ "${MDADM_MD_CHECK:-no}" = "yes" ] then /usr/sbin/service start mdcheck_start.timer fi } #--------------------------------------------------------------------------- # stop #--------------------------------------------------------------------------- mdadm_stop() { /usr/sbin/service --msg="Stop service" stop mdmonitor.service mdmonitor-oneshot.timer if [ "${MDADM_MD_CHECK:-no}" = "yes" ] then /usr/sbin/service stop mdcheck_start.timer mdcheck_continue.timer fi } #--------------------------------------------------------------------------- # status #--------------------------------------------------------------------------- mdadm_status() { /usr/sbin/service --msg="Show status" status mdmonitor.service mdmonitor-oneshot.timer if [ "${MDADM_MD_CHECK:-no}" = "yes" ] then /usr/sbin/service status mdcheck_start.timer mdcheck_continue.timer fi } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { case ${1} in status) mdadm_status ;; stop) mdadm_stop ;; start) mdadm_start ;; esac anykey } # --------------------------------------------------------------------------- # call function main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------