From 873418e24be747f5579bc5de3b4740762a1562e4 Mon Sep 17 00:00:00 2001 From: pierreozoux Date: Sat, 6 Aug 2016 13:03:11 +0100 Subject: [PATCH] universal restart command! --- utils/systemctl_commands | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/utils/systemctl_commands b/utils/systemctl_commands index 6488ad1..60915d5 100755 --- a/utils/systemctl_commands +++ b/utils/systemctl_commands @@ -1,4 +1,15 @@ #!/bin/bash -domain=`pwd | cut -d'/' -f4` -systemctl `basename "$0"` u@$domain +command=`basename "$0"` +first_level_path=`pwd | cut -d'/' -f2` +second_level_path=`pwd | cut -d'/' -f3` + +if [ "$first_level_path" == "system" ]; then + module=`pwd | cut -d'/' -f3` + systemctl $command s@$module +elif [ "$first_level_path" == "data" ]; then + if [ "$second_level_path" == "domains" ]; then + domain=`pwd | cut -d'/' -f4` + systemctl $command u@$domain + fi +fi -- GitLab