Last active
June 24, 2023 00:06
-
-
Save pandolfipedro/bd86c12da54c308742d97dc7017bfbfa to your computer and use it in GitHub Desktop.
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
Method to update time every boot on orange pi and similar boards. | |
Get updated time and date from google using: | |
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" | |
Then now edit the /etc/rc.local file to update in every boot | |
sudo nano /etc/rc.local | |
sudo chmod +x /etc/rc.local | |
sudo chmod +x /etc/systemd/system/rc-local.service | |
############ CREATE RC.LOCAL SERVICE ########### | |
sudo nano /etc/systemd/system/rc-local.service | |
copy and paste: | |
[Unit] | |
Description=/etc/rc.local Compatibility | |
ConditionPathExists=/etc/rc.local | |
[Service] | |
Type=forking | |
ExecStart=/etc/rc.local start | |
TimeoutSec=0 | |
StandardOutput=tty | |
RemainAfterExit=yes | |
SysVStartPriority=99 | |
[Install] | |
WantedBy=multi-user.target | |
#### then | |
sudo systemctl enable rc-local | |
sudo systemctl start rc-local.service | |
#### check | |
sudo systemctl status rc-local.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment