diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2021-11-24 09:56:38 +0100 |
---|---|---|
committer | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2021-11-24 09:56:38 +0100 |
commit | e2a04dd61f98d57d2ba00026b1eb03489e05c9bd (patch) | |
tree | bf06f9109d1fe3d455b0f36eadd123e9cc18d2c0 /mule | |
parent | a18134a84c69ba659ebe903400ce9b3a3c73e5c0 (diff) |
mule: mule.sh: remove bashism
Outside of this read line, the rest is POSIX compliant, so better not
depend on bash if possible which makes it easier on systems built with
Buildroot or Yocto where bash might not be available by default.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'mule')
-rwxr-xr-x | mule/mule.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mule/mule.sh b/mule/mule.sh index b05099f..18cf3f5 100755 --- a/mule/mule.sh +++ b/mule/mule.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh SYSFSPATH=/sys/class/gpio @@ -25,7 +25,8 @@ usage() { gpiosetup() { for PIN in ${RESET_PIN},${RESET_INVERT} ${BOOT0_PIN},${BOOT0_INVERT} do - IFS=',' read PINNUM INVERT <<< "${PIN}" + PINNUM=$(echo "$PIN" | cut -d',' -f1) + INVERT=$(echo "$PIN" | cut -d',' -f2) if [ ! -d ${SYSFSPATH}/gpio${PINNUM} ] ; then echo ${PINNUM} > ${SYSFSPATH}/export fi |