ertagh / teamspeak3-server-arm

161 stars 11 forks source link

Server Update check daily instead of every sunday? #34

Closed capsload2 closed 2 years ago

capsload2 commented 2 years ago

Hey,

where do i need to change the update check, now its only on Sunday, i want it everyday at 6:00am :)

ertagh commented 2 years ago

Hi there,

for everyone interested: The check time is defined within root/teamspeak/sh/helper.sh at the bottom of the file.

So for your needs you may want to try something out like: seconds_next_sunday=$(($(date --date '05:59:59' +%s) - $(date +%s) + 1))

Basic explanation: First you check for the next timestamp a second before 6:00 am, next substract the current timestamp. Why add 1? Just to be sure that when the next check is running it has to be after 05:59:59.. so no problem should occour.

Greetings

ertagh commented 2 years ago

35

Sorry for the late reply. It seems like the custom code for the daily check isn't working as expected... I will continue within this issue due to the same reason.

I can try to get it working but I'm currently busy studying. So it will take a week until I can have a look at it.

capsload2 commented 2 years ago

Got anything yet?

ertagh commented 2 years ago

Sorry for the late reply. I totally forgot about that...

Well I tested the command under ubuntu and everything worked fine BUT you are right: It actually behauvious different under debian.

This time I actually tried it inside the container and can confirm that it works seconds_next_sunday=$(($(date --date '06:00:00' +%s) - $(date +%s) + 86400))