From e19f997b3f9054263ad3339ba4d30243248da66d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Sat, 12 Dec 2015 16:57:40 +0100 Subject: [PATCH] if systemctl show fails, use /usr/lib/systemd/system/ path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- helper_lib.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helper_lib.sh b/helper_lib.sh index 69ba6ee..ed966ab 100644 --- a/helper_lib.sh +++ b/helper_lib.sh @@ -88,5 +88,11 @@ get_docker_effective_command_line_args() { get_systemd_service_file(){ SERVICE="$1" - systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//' + + systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2 + if [ $? -eq 0 ]; then + systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//' + else + echo "/usr/lib/systemd/system/$SERVICE" + fi }