#!/bin/bash

SERVICE="<service-name>"

if ! rc-service $SERVICE status | grep -q "started"; then
  echo "$(date): $SERVICE is down. Restarting..." >> /var/log/service-monitor.log
  rc-service $SERVICE restart
fi
