From f51706ff011fb2e663721afe9b8389a83940ae08 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 16 Apr 2022 10:56:56 +0800
Subject: [PATCH] update pinctrl shell script

---
 bsp/rootfs/files/pinctrl |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bsp/rootfs/files/pinctrl b/bsp/rootfs/files/pinctrl
index 7d56efd..a3b55b6 100755
--- a/bsp/rootfs/files/pinctrl
+++ b/bsp/rootfs/files/pinctrl
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # This shell script used to control GPIO port on IGKBoard
 
 direction=out
@@ -100,7 +100,7 @@
     cat $pindir/value
 }
 
-if [ $# -lt 1 ] ; then
+if [[ $# -lt 1 ]] ; then
    usage;
 fi
 
@@ -108,12 +108,12 @@
 do
     case "${OPTNAME}" in
         "i")
-           direction=in
+           direction="in"
            shift
            ;;
 
         "u")
-           action=unexport;
+           action="unexport";
            shift
            ;;
 
@@ -130,14 +130,14 @@
 
 calc_pinum $1
 
-if [[ $action == unexport ]] ; then
+if [[ "$action" == "unexport" ]] ; then
    unexport_gpio
    exit;
 fi
 
 export_gpio
 
-if [ $direction == in ] ; then
+if [[ "$direction" == "in" ]] ; then
    read_gpio
 else
    set_gpio $2

--
Gitblit v1.9.1