Last active
January 16, 2021 21:45
-
-
Save stokito/4a145d73402946ba6ec8d3a3ca83e1ae to your computer and use it in GitHub Desktop.
htpdate service on busybox httpd. Put the script to /cgi-bin/date.sh and call it like curl http://localhost:8080/cgi-bin/date.sh -v
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
#!/bin/sh | |
# This is run once a day - don't care about performance | |
# RFC date must have GMT in the end | |
# but GNU date return +0000 instead and bb date returns UTC | |
# So we must strip +0000 or UTC and add GMT ourselves | |
DATE=$(date -R -u | sed 's/\UTC/GMT/' | sed 's/\+0000/GMT/') | |
echo "Date: $DATE\nStatus: 200\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment