From 6124d1b8994b0a1f2ebc9f33453bfda8901afb05 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 16 Nov 2019 15:33:51 +0100 Subject: [PATCH] Only run these commands if the variables are not empty --- data/helpers.d/systemd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/data/helpers.d/systemd b/data/helpers.d/systemd index 4b3b5a289..105678b88 100644 --- a/data/helpers.d/systemd +++ b/data/helpers.d/systemd @@ -165,9 +165,15 @@ ynh_systemd_action() { # # usage: ynh_clean_check_starting ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 + if [ -n "$pid_tail" ] + then + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + fi + if [ -n "$templog" ] + then + ynh_secure_remove "$templog" 2>&1 + fi }