Use sysconfig file to get the list of services

This commit is contained in:
Graham Mainwaring 2020-04-24 14:08:24 -04:00
parent e36ffa5764
commit d55b223aae

View File

@ -1,13 +1,15 @@
#!/bin/bash
SERVICES="ansible-tower.service supervisord.service"
if [ -f /etc/sysconfig/ansible-tower ]; then
source /etc/sysconfig/ansible-tower
fi
case "$1" in
start|stop|restart)
systemctl $1 ansible-tower.service
exec systemctl $1 ansible-tower.service
;;
status)
systemctl status $SERVICES
exec systemctl status ansible-tower.service $TOWER_SERVICES
;;
*)
echo "Usage: ansible-tower-service start|stop|restart|status"