#!/bin/sh class="${1}" name="${2}" state="${3}" case "${state}" in "MASTER" | "FAULT") systemctl start "${name}" ;; "BACKUP" | "STOP") systemctl stop "${name}" ;; *) logger "keepalived unknown state for ${name}: ${state}" exit 1 ;; esac