#!/bin/sh

. /etc/ha.d/shellfuncs
. /etc/alterator/hotstandby/ahs.cfg

SERVICE=/sbin/service
AHS_CSYNC2_PERIODIC=/usr/lib/alterator-hotstandby/ahs_csync2_periodic

case "$1" in
    start)
    "$SERVICE" csync2 condstop &&
    "$AHS_CSYNC2_PERIODIC" start "$csync2_period" &&
    ha_pseudo_resource ahs_csync2 start
    ;;
    stop)
    "$AHS_CSYNC2_PERIODIC" stop >/dev/null 2>&1
    "$SERVICE" csync2 start >/dev/null 2>&1 &&
    ha_pseudo_resource ahs_csync2 stop
    ;;
    *)
    ha_pseudo_resource ahs_csync2 "$1"
    ;;
esac

