Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #4 from mariux64/accept-systemd-service-unit
mxservicectl: Accept service unit name in mxstartups
  • Loading branch information
donald committed Apr 12, 2018
2 parents 0b543dc + 6f0dd5f commit e89261f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions mxservicectl
Expand Up @@ -19,7 +19,14 @@ function mxsrv_start_one() {

. ${cfg}

su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} start" &
case "${MX_SRV_SCRIPT}" in
*.service)
systemctl start "${MX_SRV_SCRIPT}"
;;
*)
su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} start" &
;;
esac

mv ${cfg}{,.r}

Expand All @@ -34,7 +41,14 @@ function mxsrv_stop_one() {

. ${cfg}

su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} stop" &
case "${MX_SRV_SCRIPT}" in
*.service)
systemctl stop "${MX_SRV_SCRIPT}"
;;
*)
su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} stop" &
;;
esac

rm ${cfg}

Expand Down

0 comments on commit e89261f

Please sign in to comment.