From dacf2f5fd721820a023b8fe164c61d094f46e696 Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 3 Nov 2017 21:12:35 -0500 Subject: [PATCH] Fix for ombi not starting when script run as root --- update_ombi.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update_ombi.sh b/update_ombi.sh index 4358a8c..9800c79 100644 --- a/update_ombi.sh +++ b/update_ombi.sh @@ -147,6 +147,7 @@ if [ "`systemctl is-active $ombiservicename`" == "active" ]; then if [ $? -ne 0 ] || [ "`systemctl is-active $ombiservicename`" == "active" ] ; then if [ $i -lt $j ]; then .log 3 "Failed to stop Ombi...[attempt $i of $j]" + sleep 1 else .log 2 "Failed to stop Ombi...[attempt $i of $j]...Bailing!" exit 2 @@ -176,13 +177,14 @@ if [ $running -eq 1 ]; then while [ $i -le $j ] do if [ $scriptuser = "root" ]; then - systemctl systemctl start $ombiservicename.service > /dev/null 2>&1 + systemctl start $ombiservicename.service > /dev/null 2>&1 else sudo systemctl start $ombiservicename.service > /dev/null 2>&1 - fi + fi if [ $? -ne 0 ] || [ "`systemctl is-active $ombiservicename`" != "active" ] ; then if [ $i -lt $j ]; then .log 3 "Failed to start Ombi...[attempt $i of $j]" + sleep 1 else .log 2 "Failed to start Ombi...[attempt $i of $j]...Bailing!" exit 3