@( \
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 \
snapshot snapshot_tool \
$RAMFS_COPY_BIN
do
- local file="$(which "$binary" 2>/dev/null)"
+ local file="$(command -v "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh $RAMFS_COPY_DATA
}
local _c=0
- local nas="$(which nas)"
+ local nas="$(command -v nas)"
local if_pre_up if_up nas_cmd
local vif vif_pre_up vif_post_up vif_do_up vif_txpower
local bssmax=$(wlc ifname "$device" bssmax)
return 1
}
- which mkswap >/dev/null || {
+ command -v mkswap >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed"
return 1
}
- which swapon >/dev/null || {
+ command -v swapon >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed"
return 1
}
- which swapoff >/dev/null || {
+ command -v swapoff >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed"
return 1
}
set -e
version=1.0
-FIND="$(which find)"
-FIND="${FIND:-$(which gfind)}"
-TAR="${TAR:-$(which tar)}"
-GZIP="$(which gzip)"
+FIND="$(command -v find)"
+FIND="${FIND:-$(command -v gfind)}"
+TAR="${TAR:-$(command -v tar)}"
+GZIP="$(command -v gzip)"
# try to use fixed source epoch
if [ -n "$SOURCE_DATE_EPOCH" ]; then
# look up date of last commit
elif [ -d "$TOPDIR/.git" ]; then
- GIT="$(which git)"
+ GIT="$(command -v git)"
TIMESTAMP=$(cd $TOPDIR; $GIT log -1 -s --format=%ci)
elif [ -d "$TOPDIR/.svn" ]; then
- SVN="$(which svn)"
+ SVN="$(command -v svn)"
TIMESTAMP=$($SVN info "$TOPDIR" | sed -n "s/^Last Changed Date: \(.*\)/\1/p")
else
TIMESTAMP=$(date)