Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. #!/bin/sh -e
  2. #
  3. # rc.local
  4. #
  5. # This script is executed at the end of each multiuser runlevel.
  6. # Make sure that the script will "exit 0" on success or any other
  7. # value on error.
  8. #
  9. # In order to enable or disable this script just change the execution
  10. # bits.
  11. #
  12. # By default this script does nothing.
  13.  
  14. # Print the IP address
  15. _IP=$(hostname -I) || true
  16. if [ "$_IP" ]; then
  17.   printf "My IP address is %s\n" "$_IP"
  18. fi
  19.  
  20. # Part of DS2482 I2C 1-Wire Master to Volkszaehler.
  21. echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
  22.  
  23. # Register I2C RTC
  24. echo ds1307 0x68 > /sys/bus/i2c/devices/i2c-1/new_device
  25.  
  26. # GPIOs exportieren und Datenrichtung einstellen.
  27. echo 24 > /sys/class/gpio/export
  28. echo 25 > /sys/class/gpio/export
  29. echo out > /sys/class/gpio/gpio24/direction
  30. echo out > /sys/class/gpio/gpio25/direction
  31.  
  32. #Set Systemtime from RTC
  33. sudo hwclock -s
  34.  
  35. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement