I have the following: server pi and client pi both running latest update version Raspbian Stretch
I have a .sh script on the client pi to update the time from my server pi. When I run this manually it works but i'm battling to have this process automated on client pi reboot.
root@MediaClient:/etc# date +%Y%m%d%T -s "`ssh email@example.com 'date "+%Y%m%d %T"'`" firstname.lastname@example.org's password: 2017092416:27:03
my rc.local looks like this:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi sh /BBTV/sh/Startup.sh exit 0
I made sure rc.local is executable:
root@MediaClient:/etc# ls -l /etc/rc.local -rwxr-xr-x 1 root root 444 Sep 24 16:31 /etc/rc.local
I made sure rc.local has a shebang line:
root@MediaClient:/etc# head -n1 /etc/rc.local #!/bin/sh -e
what am I missing to do? Any help will be appreciated.