diff --git a/config.lua b/config.lua index d521a0b..052043d 100644 --- a/config.lua +++ b/config.lua @@ -14,8 +14,8 @@ local config = { version="0.0.1", bucket_name="txweaboo", --aws s3 bucket, created manually to prevent terraform from trying to delete it. instance_name="Weaboos Anonymous", -- Name to use for the multimc instance - server_starts="1 16 * * 1,4", --Starts at 4pm on Mondays and Thursdays - server_stops="1 1 * * 2,5", --Server stops at 1am on Tuesdays and Fridays + server_starts="1 11 * * 1,4", --Starts at 4pm on Mondays and Thursdays + server_stops="1 19 * * 1,4", --Server stops at 1am on Tuesdays and Fridays } -- Each machine gets a startup script, located in src/startup that configures diff --git a/src/data/index.html.etlua b/src/data/index.html.etlua index 739230a..4c7f9f2 100644 --- a/src/data/index.html.etlua +++ b/src/data/index.html.etlua @@ -19,6 +19,7 @@ var stops_sched = "<%- config.server_stops %>"; var starts = later.parse.cron(starts_sched); var stops = later.parse.cron(stops_sched); + var offset = -(new Date().getTimezoneOffset() / 60) var cronstrue; var soon_el, starts_el, stops_el; @@ -42,8 +43,8 @@ soon_el = document.getElementById("soon"); starts_el = document.getElementById("starts"); stops_el = document.getElementById("stops"); - starts_el.innerText = cronstrue.toString(starts_sched); - stops_el.innerText = cronstrue.toString(stops_sched); + starts_el.innerText = cronstrue.toString(starts_sched, {"tzOffset": offset}); + stops_el.innerText = cronstrue.toString(stops_sched, {"tzOffset": offset}); set_timer(); }); diff --git a/src/startup/main.sh.etlua b/src/startup/main.sh.etlua index 95a621b..454035a 100644 --- a/src/startup/main.sh.etlua +++ b/src/startup/main.sh.etlua @@ -13,7 +13,7 @@ aws configure set aws_secret_access_key "<%- secrets.aws.secret_key %>" mkdir /mnt mount /dev/sdf /mnt -sudo yum install java-17-amazon-corretto-devel -y +sudo yum install cronie java-17-amazon-corretto-devel -y cd /mnt # Download the dedicated server if we don't have it @@ -74,3 +74,5 @@ cat > cronfile </backup EOF crontab cronfile +service crond start +systemctl enable crond diff --git a/src/startup/sidecar.sh.etlua b/src/startup/sidecar.sh.etlua index 0f56a27..6478e5a 100644 --- a/src/startup/sidecar.sh.etlua +++ b/src/startup/sidecar.sh.etlua @@ -98,3 +98,5 @@ cat > cronfile < /root/stop.sh EOF crontab cronfile +service crond start +systemctl enable crond