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.
This commit is contained in:
Ratatoskr 2024-02-13 09:48:10 +01:00
parent 5224de0d20
commit e8599fda30
Signed by: Ratatoskr
GPG Key ID: 28B77439A6D78F4E

View File

@ -127,7 +127,7 @@ check_notification() {
echo "$output" echo "$output"
pkill rgb.sh # Kill the rgb.sh script pkill rgb.sh # Kill the rgb.sh script
iobroker state set zigbee.0.04cd15fffee03198.state false 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 /root/iobroker_scripts/general/generate_text.sh # Call generate_text.sh script
exit # Exit the script when the alarm is turned off exit # Exit the script when the alarm is turned off
else else
@ -139,7 +139,7 @@ check_notification() {
fi fi
done done
# Phone could not be reached. # Phone could not be reached.
echo "Phone could not be reached after $max_attempts attempts." echo "Phone could not be reached after $max_attempts attempts."
date && echo "Alarm turned off." date && echo "Alarm turned off."
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv' ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
@ -219,7 +219,7 @@ current_colortemp="$end_colortemp"
set_brightness "$end_brightness" set_brightness "$end_brightness"
set_colortemp "$end_colortemp" 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. # Execute the check_ip function.
check_ip check_ip