diff --git a/src/script.sh b/src/script.sh index 71c5634..0bf10dc 100644 --- a/src/script.sh +++ b/src/script.sh @@ -1,8 +1,13 @@ #!/bin/sh -# works best on busybox sh - -set -efux -o pipefail +## dash does not support pipefail +# this does not work in `dash script.sh` +DASH=$(readlink -f "/bin/sh" | grep "dash" || [ $? = 1 ]) +if [ -n "$DASH" ]; then + set -efx +else + set -efx -o pipefail +fi ## Use GNU grep, busybox grep is too slow