Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- morse2.sh 36: morse2.sh: Syntax error: "(" unexpected.
- #!/bin/bash
- #be sure you have already installed nmap on your PI
- PORT=11005
- CW_PIN=25
- echo "Start listening on port $PORT ..."
- while read line
- do
- #echo $line
- #echo $line | od -An -t uC
- cmd=${line:0:1}
- #echo $cmd
- #echo $cmd | od -An -t uC
- case "$cmd" in
- 0) #echo "000"
- gpio write $CW_PIN 0
- ;;
- 1) #echo "111"
- gpio write $CW_PIN 1
- ;;
- 3) echo "Going to stop listener ..."
- break
- ;;
- *) #echo "unknown cmd"
- ;;
- esac
- done < <((echo "Welcome. Please give me one of the following commands: 0 | 1 | 3") | ncat -k -l $PORT)
- echo "... listener stopped."
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement