mirror of
https://github.com/johndoe6345789/SparkOS.git
synced 2026-04-24 13:34:56 +00:00
Optimize test script to avoid redundant busybox --list calls
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -23,12 +23,14 @@ if command -v busybox >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Available BusyBox applets (sample):"
|
echo "Available BusyBox applets (sample):"
|
||||||
busybox --list | head -n 20
|
# Store applet list once to avoid redundant executions
|
||||||
echo " ... and $(busybox --list | wc -l) total applets"
|
APPLET_LIST=$(busybox --list)
|
||||||
|
echo "$APPLET_LIST" | head -n 20
|
||||||
|
echo " ... and $(echo "$APPLET_LIST" | wc -l) total applets"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Networking applets (required for SparkOS):"
|
echo "Networking applets (required for SparkOS):"
|
||||||
for cmd in udhcpc ip ifconfig ping wget; do
|
for cmd in udhcpc ip ifconfig ping wget; do
|
||||||
if busybox --list | grep -q "^${cmd}$"; then
|
if echo "$APPLET_LIST" | grep -q "^${cmd}$"; then
|
||||||
echo " ✓ $cmd"
|
echo " ✓ $cmd"
|
||||||
else
|
else
|
||||||
echo " ✗ $cmd (NOT FOUND)"
|
echo " ✗ $cmd (NOT FOUND)"
|
||||||
|
|||||||
Reference in New Issue
Block a user