#!/bin/bash

AWX_SERVICES="postgresql redis nginx supervisord"

case "$1" in
        start|stop|restart)
                exec systemctl $1 ansible-awx.service supervisord.service
                ;;
        status)
                exec systemctl status ansible-awx.service $AWX_SERVICES
                ;;
        *)
                echo "Usage: ansible-awx-service start|stop|restart|status"
                exit 1
                ;;
esac
