1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh set -e pkg install -y "$@" && exit 0 cat <<EOF pkg install failed dmesg tail: $(dmesg | tail) trying again EOF pkg install -y "$@"