
if [ -d lib ];then
 if [ "`ls -1 lib/ | grep 'libiw'`" != "" ];then
  UPKGVERSION=`ls -1 lib/ | grep 'libiw.so.[0-9]' | head -n 1 | rev | cut -f 1 -d '.' | rev`
  OLDPKGVER=`expr $UPKGVERSION - 1`
  ln -s libiw.so.${UPKGVERSION} lib/libiw.so.${OLDPKGVER}
  OLDPKGVER=`expr $OLDPKGVER - 1`
  ln -s libiw.so.${UPKGVERSION} lib/libiw.so.${OLDPKGVER}
 fi
fi

if [ -d usr/lib ];then
 if [ "`ls -1 usr/lib/ | grep 'libiw'`" != "" ];then
  UPKGVERSION=`ls -1 usr/lib/ | grep 'libiw.so.[0-9]' | head -n 1 | rev | cut -f 1 -d '.' | rev`
  OLDPKGVER=`expr $UPKGVERSION - 1`
  ln -s libiw.so.${UPKGVERSION} usr/lib/libiw.so.${OLDPKGVER}
  OLDPKGVER=`expr $OLDPKGVER - 1`
  ln -s libiw.so.${UPKGVERSION} usr/lib/libiw.so.${OLDPKGVER}
 fi
fi
