[ ! -x "$rc" ] && return
case $1 in
- start) $rc running || $rc start ;;
- stop) $rc running && $rc stop ;;
+ start) _service_running_check "$rc" || $rc start ;;
+ stop) _service_running_check "$rc" && $rc stop ;;
reload)
- if $rc running; then
+ if _service_running_check "$rc"; then
$rc reload
else
$rc start
fi
;;
restart)
- if $rc running; then
+ if _service_running_check "$rc"; then
$rc restart
else
$rc start
esac
}
+_service_running_check() {
+ skip_running_check || "$1" running
+}
+
_start_service() {
_service start
}
get_var_flag NOTIFY_BACKUP_STOP 1
}
+set_skip_running_check() {
+ set_var NOTIFY_SKIP_RUNNING 1
+}
+
+skip_running_check() {
+ get_var_flag NOTIFY_SKIP_RUNNING
+}
+
set_reload_if_sync() {
set_var NOTIFY_SYNC_RELOAD "${1:-1}"
}