#!/bin/bash

case "$1" in
        start|stop|restart|enable|disable|status)

                if systemctl list-unit-files -q "automation-eda-controller.service" | grep -q "automation-eda-controller.service" ; then
                        exec systemctl $1 automation-eda-controller-event-stream.service
                else
                        exec systemctl $1 automation-eda-controller-event-stream.service nginx.service
                fi
                ;;
        *)
                echo "Usage: automation-eda-controller-event-stream-service start|stop|restart|status|enable|disable"
                exit 1
                ;;
esac
