Advertisement
Guest User

Omega2 + RDM6300

a guest
Jun 20th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1.  
  2. #!/bin/bash
  3.  
  4. denyentry() {
  5.   gpioctl dirout-low 19
  6.   sleep 1
  7.   gpioctl dirout-high 19
  8. }
  9.  
  10. openentry() {
  11.   gpioctl dirout-low 3
  12.   gpioctl dirout-low 18
  13.   sleep 5
  14.   gpioctl dirout-high 3
  15.   gpioctl dirout-high 18
  16. }
  17.  
  18. booting() {
  19.   gpioctl dirout-low 18
  20.   sleep 1
  21.   gpioctl dirout-high 18
  22. }
  23.  
  24. stty -F /dev/ttyS1 raw speed 9600
  25.  
  26. echo "BOOTING"
  27. booting
  28.  
  29. while [ 1 ]; do
  30.   READ=`dd if=/dev/ttyS1 count=1`
  31.   CARD=$(echo $READ| cut -c 0-12)
  32.   RFID=$(echo $CARD| cut -c 4-11)
  33.   RFID="00$RFID"
  34.  
  35.  
  36.   echo "PROCESSING RFID:"
  37.   echo $RFID
  38.  
  39.   if [ "$RFID" = "00006A82A0" ]; then
  40.    openentry
  41.   else
  42.    denyentry
  43.   fi
  44.  
  45. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement