فهرست منبع

Update generate_config.sh

exit on error and pipefail
minor fix " ; then" to ";then"
eXtremeSHOK 7 سال پیش
والد
کامیت
40885b7fd6
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      generate_config.sh

+ 6 - 2
generate_config.sh

@@ -1,10 +1,14 @@
 #!/bin/bash
 #!/bin/bash
 
 
-if grep --help 2>&1 | head -n 1 | grep -q -i "busybox" ; then
++#exit on error and pipefail
++set -o errexit
++set -o pipefail
+
+if grep --help 2>&1 | head -n 1 | grep -q -i "busybox"; then
   echo "BusybBox grep detected, please install gnu grep, \"apk add --no-cache --upgrade grep\""
   echo "BusybBox grep detected, please install gnu grep, \"apk add --no-cache --upgrade grep\""
   exit 1
   exit 1
 fi
 fi
-if cp --help 2>&1 | head -n 1 | grep -q -i "busybox" ; then
+if cp --help 2>&1 | head -n 1 | grep -q -i "busybox"; then
   echo "BusybBox cp detected, please install coreutils, \"apk add --no-cache --upgrade coreutils\""
   echo "BusybBox cp detected, please install coreutils, \"apk add --no-cache --upgrade coreutils\""
   exit 1
   exit 1
 fi
 fi