File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ LOG_FILE=" /var/log/reboot_check.log"
4
+
5
+ if [ -f /var/run/reboot-required ]; then
6
+ echo " Reboot required on $( date) " >> " $LOG_FILE "
7
+ # Uncomment the next line to automatically reboot
8
+ /sbin/reboot
9
+ fi
Original file line number Diff line number Diff line change 48
48
mode : ' 0644'
49
49
modification_time : preserve
50
50
access_time : preserve
51
+
52
+ - name : Copy the reboot check script to the server
53
+ copy :
54
+ src : " check_reboot.sh"
55
+ dest : /usr/local/bin/check_reboot.sh
56
+ owner : root
57
+ group : root
58
+ mode : ' 0755'
59
+
60
+ - name : Schedule cron job to run the reboot check at 0400hrs daily
61
+ cron :
62
+ name : " Check if reboot is required"
63
+ minute : " 0"
64
+ hour : " 4"
65
+ job : " /usr/local/bin/check_reboot.sh"
You can’t perform that action at this time.
0 commit comments