#!/bin/bash echo "Activate and initiate RTC-HW-clock..." echo "Current system date time is:" $(date) echo "Adding RTC to list of new I²C devices..." sudo bash -c "echo 'ds1307 0x68' > /sys/class/i2c-adapter/i2c-1/new_device" echo "RTC is currently set to:" $(sudo hwclock -r) echo "Setting current date/time in RTC clock..." $(sudo hwclock -w) echo "RTC is now set to:" $(sudo hwclock -r) echo "Tell system to sync system time with RTC..." $(sudo hwclock -s) echo "System is running now with HW clock and current date/time is:" $(date) echo "Done!"