Improve a bit shell scripts portability.

- Use /bin/sh: bash is not required here;
  - Avoid Perl regexp in grep(1): this is a GNU extension;
  - While here, make ReadNavigo.sh fail earlier if pn53x-tamashell
    fails at first invocation.

Reported by:	Ganael Laplanche <martymac@FreeBSD.org>
This commit is contained in:
Romain Tartière 2013-05-25 13:26:41 +02:00
parent 16a5fc419c
commit 27c43e8b8a
2 changed files with 8 additions and 3 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
cat << EOF | \
pn53x-tamashell |\

View file

@ -1,9 +1,9 @@
#!/bin/bash
#!/bin/sh
ID=$(cat << EOF | \
pn53x-tamashell |\
grep -A1 "^Tx: 42 01 0b 3f 80" |\
grep -o -P "(?<=Rx: 00 .. .. ).. .. .. .."|sed 's/ //g'
sed -e '1d' -e "s/^Rx: 00 .. .. \(.. .. .. ..\).*/\1/" -e 's/ //g'
# Timeouts
3205000002
# ListTarget ModeB
@ -13,6 +13,11 @@ ID=$(cat << EOF | \
EOF
)
if [ -z "$ID" ]; then
echo "Error: I was not abble to read Navigo ID" >&2
exit 1
fi
cat << EOF | \
pn53x-tamashell |\
awk '\