#!/bin/sh
# version 0.1

. ./installink.sh
. ./!vda_ver

bin=bin
STATIC=/usr/app/$NAME$VER

applets=`./busybox 2>&1 \
| {
while read -r line; do
    if echo "$line" \
    | grep -F "Currently defined functions:" >/dev/null 2>&1; then
	break
    fi
done
if ! test "$line"; then exit; fi
while read -r line; do echo -n "$line "; done \
| sed "s/   */ /g" | sed "s/, / /g"
}
`

echo "I'm going to do: ln -s $STATIC/busybox $bin/\$name"
echo -n "names:"
for a in $applets; do
    if ! test -e "$bin/$a"; then
	echo -n " $a"
    fi
done
echo

echo -n "Press <Enter> to continue or Ctrl-C to exit: "; read junk

mkdir "$bin"
for a in $applets; do
    if ! test -e "$bin/$a"; then
	ln -s "$STATIC/busybox" "$bin/$a"
    fi
done
