Open
Conversation
Date time fix for Static IP
Collaborator
|
@kittenarmy I dont understand why this would be needed. Why does ntp not work for you? |
Contributor
|
I also don't understand why a static IP would require different treatment of NTP, which is a higher level service |
Author
I've no idea why it doesn't work. Read what I tried in #1797. I can only get NTP to work over SSH. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
sharmay
reviewed
Jan 20, 2023
| if [ -f $CONFIGPATH/staticip.conf -a -f $CONFIGPATH/resolv.conf -a -f $CONFIGPATH/defaultgw.conf ]; then | ||
| str=$(/system/sdcard/bin/curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g') | ||
| d=$(date -d "$str" -D "%a, %d %b %Y %T %Z" +'%Y-%m-%d %H:%M:%S') | ||
| date -s "$d" |
There was a problem hiding this comment.
Suggested change
| date -s "$d" | |
| date -u -s "$d" |
Date/Time will be wrong, date/time retrieved via curl are in GMT (during my testing).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Date time fix for Static IP #1797