bash: fix postinst script
authorYousong Zhou <yszhou4tech@gmail.com>
Wed, 9 May 2018 12:14:32 +0000 (20:14 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Wed, 9 May 2018 12:14:50 +0000 (20:14 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
utils/bash/Makefile

index 05931463af281d34bb48a8dad798291a100a6781..76f30c97740b92dec73a2a3dcec657143c5f0777 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bash
 PKG_VERSION:=4.4.18
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/bash
@@ -75,9 +75,10 @@ CONFIGURE_ARGS+= \
 
 define Package/bash/postinst
 #!/bin/sh
-grep bash $${IPKG_INSTROOT}/etc/shells || \
-       echo "/bin/bash" >> $${IPKG_INSTROOT}/etc/shells
-       echo "/bin/rbash" >> $${IPKG_INSTROOT}/etc/shells
+grep -q bash "$${IPKG_INSTROOT}/etc/shells" || {
+       echo /bin/bash >> "$${IPKG_INSTROOT}/etc/shells"
+       echo /bin/rbash >> "$${IPKG_INSTROOT}/etc/shells"
+}
 endef
 
 define Package/bash/install