-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: systemd service now references script
- Loading branch information
1 parent
3a0e29d
commit 429682b
Showing
5 changed files
with
36 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
## | ||
## This script checks the current UTC time, and based on that time | ||
## enables or disables the pretix maintenance mode. | ||
## | ||
## USAGE: pretix_maintenance.sh | ||
## | ||
|
||
# Unofficial Bash strict mode | ||
set -eEfuo pipefail | ||
IFS=$'\n\t' | ||
|
||
MARKER_PATH='/var/www/pretix/MAINTENANCE_MODE' | ||
|
||
HOUR=$(date -u +%H) # UTC hour | ||
DAY=$(date -u +%a) # UTC day | ||
|
||
if [[ "$DAY" == "su" && $HOUR -gt 21 || "$DAY" == "mo" && $HOUR -lt 5 ]] | ||
then touch "$MARKER_PATH"; # Enable maintenance mode | ||
else rm "$MARKER_PATH"; # Disable maintenance mode | ||
fi | ||
|
||
systemctl reload nginx # Apply changes |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters