Closed littlejeem closed 4 years ago
testing 2b0a1d1 this shows the correct directory, now need to test in a root cron job
2b0a1d1 Results from this test are:
From root@pi_grown_up.home Fri Jun 12 15:30:01 2020
Return-Path: <root@pi_grown_up.home>
X-Original-To: root
Delivered-To: root@pi_grown_up.home
Received: by pi_grown_up.home (Postfix, from userid 0)
id 36FABA521B; Fri, 12 Jun 2020 15:30:01 +0100 (BST)
From: root@pi_grown_up.home (Cron Daemon)
To: root@pi_grown_up.home
Subject: Cron <root@pi_grown_up> /home/pi/bin/monitor_scripts/services_checker.sh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20200612143001.36FABA521B@pi_grown_up.home>
Date: Fri, 12 Jun 2020 15:30:01 +0100 (BST)
/home/pi/bin/monitor_scripts/services_checker.sh: 12: /home/pi/bin/monitor_scripts/services_checker.sh: transmission-daemon=1: not found
/home/pi/bin/monitor_scripts/services_checker.sh: 22: /home/pi/bin/monitor_scripts/services_checker.sh: Syntax error: "(" unexpected
Need to look into this more...
commenting out
#service_name="transmisson-daemon"
#service_selection=${transmission-daemon}
#check_selection
prevents...
/home/pi/bin/monitor_scripts/services_checker.sh: 12: /home/pi/bin/monitor_scripts/services_checker.sh: transmission-daemon=1: not found
...for testing purposes
re-ran test via root crontab, altering incorrect shebang, log generated results as expected
#
-----------------------------------------------------------------------------
script STARTED
I would source /config.sh in real world
jackett is NOT selected for checking
lidarr is NOT selected for checking
sonarr is NOT selected for checking
radarr is NOT selected for checking
script ENDED
-----------------------------------------------------------------------------
#
in services_checker.sh intended selectable variables...
...are contained in the script, better to move to a config file.