@( \
cd $(1); \
for script in ./usr/lib/opkg/info/*.postinst; do \
- IPKG_INSTROOT=$(1) $$(which bash) $$script; \
+ IPKG_INSTROOT=$(1) $$(command -v bash) $$script; \
ret=$$?; \
if [ $$ret -ne 0 ]; then \
echo "postinst script $$script has failed with exit code $$ret" >&2; \
for script in ./etc/init.d/*; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
if ! echo " $(3) " | grep -q " $$(basename $$script) "; then \
- IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common $$script enable; \
+ IPKG_INSTROOT=$(1) $$(command -v bash) ./etc/rc.common $$script enable; \
echo "Enabling" $$(basename $$script); \
else \
- IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common $$script disable; \
+ IPKG_INSTROOT=$(1) $$(command -v bash) ./etc/rc.common $$script disable; \
echo "Disabling" $$(basename $$script); \
fi; \
done || true \