From 3204284d4ac925765ee1f01607126031ff219bcd Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 17 May 2022 17:10:55 +0800
Subject: [PATCH] add copyright in expand_rootfs  pinctrl

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

diff --git a/bsp/rootfs/files/pinctrl b/bsp/rootfs/files/pinctrl
index 7d56efd..850ecfe 100755
--- a/bsp/rootfs/files/pinctrl
+++ b/bsp/rootfs/files/pinctrl
@@ -1,5 +1,9 @@
-#!/bin/bash
+#!/bin/sh
+# Copyright (C) 2022 LingYun IoT System Studio
+# Author: Guo Wenxue<guowenxue@gmail.com>
+#
 # This shell script used to control GPIO port on IGKBoard
+#
 
 direction=out
 sysdir=/sys/class/gpio/
@@ -100,7 +104,7 @@
     cat $pindir/value
 }
 
-if [ $# -lt 1 ] ; then
+if [[ $# -lt 1 ]] ; then
    usage;
 fi
 
@@ -108,12 +112,12 @@
 do
     case "${OPTNAME}" in
         "i")
-           direction=in
+           direction="in"
            shift
            ;;
 
         "u")
-           action=unexport;
+           action="unexport";
            shift
            ;;
 
@@ -130,14 +134,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