#!/bin/sh
# version 0.7

. installink.sh

. ./!vda_ver

STATIC=/app/$NAME$VER

echo "*** Fixing paths ***"
echo
echo "This will fix STATIC=/path declarations"
echo -n "Press <Enter> to continue or Ctrl-C to exit: "; read junk

tmp="/tmp/$$-$RANDOM"
for d in *; do
    if ! test -d "$d"; then continue; fi
    echo "$d:"
    grep -r -l '^STATIC=' "$d" \
    | while read -r file; do
	echo "  $file"
	sed 's:^STATIC=.*$:'"STATIC=$STATIC:" "$file" >"$tmp"
	cat "$tmp" >"$file"
    done
done
rm "$tmp" 2>/dev/null
