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:
parent
5224de0d20
commit
e8599fda30
14
wecker.sh
14
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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user