From e8599fda301ecf13ddc67eb81d3e6eae4e630980 Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Tue, 13 Feb 2024 09:48:10 +0100 Subject: [PATCH] Update wecker.sh script This commit includes changes to the 'wecker.sh' script: - Added '&' to run 'killall mpv' command in the background to avoid blocking. - Modified the invocation of 'rgb.sh' to redirect output to /dev/null and run it in the background. - Improved comments and formatting in the script. These changes aim to optimize script execution and enhance readability. Note: Ensure that the 'rgb.sh' script runs as expected in the background. --- wecker.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wecker.sh b/wecker.sh index a0b8519..1f134e8 100755 --- a/wecker.sh +++ b/wecker.sh @@ -127,7 +127,7 @@ check_notification() { echo "$output" pkill rgb.sh # Kill the rgb.sh script iobroker state set zigbee.0.04cd15fffee03198.state false - ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv' + ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv' & /root/iobroker_scripts/general/generate_text.sh # Call generate_text.sh script exit # Exit the script when the alarm is turned off else @@ -139,7 +139,7 @@ check_notification() { fi done - # Phone could not be reached. +# Phone could not be reached. echo "Phone could not be reached after $max_attempts attempts." date && echo "Alarm turned off." ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv' @@ -219,7 +219,7 @@ current_colortemp="$end_colortemp" set_brightness "$end_brightness" set_colortemp "$end_colortemp" -/root/iobroker_scripts/schlafzimmer/rgb.sh # Call the rgb.sh script +/root/iobroker_scripts/schlafzimmer/rgb.sh >/dev/null & # Call the rgb.sh script # Execute the check_ip function. check_ip @@ -266,10 +266,10 @@ if [ $current_brightness -eq $end_brightness ] && [ $current_colortemp -eq $end_ check_external_light_status check_notification #& fi - if [ "$alarm_dismissed" = true ]; then - echo "Alarm dismissed" - exit # Exit the script when the alarm is dismissed - fi + if [ "$alarm_dismissed" = true ]; then + echo "Alarm dismissed" + exit # Exit the script when the alarm is dismissed + fi done fi