Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move countdown to function for auto update and auto reboot #392
Move countdown to function for auto update and auto reboot #392
Changes from 40 commits
019fe45
9d6b106
fd1a2de
595f0a3
ed56e0f
98f9c1e
2d34179
22683fd
8bef267
5471fb4
58a611c
7e54379
b79edce
80d4b1c
e73c9f2
098818a
600313f
25450e2
5fe4b8d
fa9735c
2c8dbf6
396a9fb
ace7b18
5962579
dc66c8b
53986bd
043af58
6e7751c
624d9ee
a35af01
0847f7b
ca6b52f
381d845
75021bd
9b075a0
18ddb66
4da9a05
24e045b
e3ae137
b089211
82536b4
131638d
958a930
1baeb04
27c1466
3e38a6e
9fb677c
5d72e7c
a718120
408617b
43ca7a2
acdf259
e58143e
f96ef24
635d201
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can do these checks before you start the countdown. Would make it a bit cleaner in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have it like that because if you so choose you could run the reboot script with no one in the server and it will reboot.
Also if it is a cron job and there is no one why not just reboot? The timer is supposed to just let players know and not prevent the reboot as that's what the enable flag is for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to negate
if [[ "${mtime}" =~ ^[0-9]+$ ]]; then
to reduce nested code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have that because the only time this is called is during a shutdown for update or reboot.
I believe both of those should happen regardless if there's a timer or not as the timer is just to let players know. If there is no timer set and there are no players I believe the action should proceed.