#!/bin/sh

PATH=/usr/bin:$PATH
export PATH

# Make sure our slib stuff is up to date.
# Stop vxconfigd before copying libraries as to avoid corruption.
LD_LIBS=/etc/lib:/usr/lib/lwp:/usr/lib:/usr/platform/`uname -i`/lib;
SO_LIBS=`LD_LIBRARY_PATH=$LD_LIBS ldd /sbin/vxconfigd \
                | awk '$NF ~ /\/usr\// { print $NF; }'`;
stop_vold=0;
for SO_LIB in ${SO_LIBS};
do
        name=`basename ${SO_LIB}`
        cmp -s ${SO_LIB} /etc/vx/slib/${name} || {
                [ $stop_vold -eq 0 ] && {
                        stop_vold=1; vxdctl stop;
                }
                cp -f ${SO_LIB} /etc/vx/slib;
        }
done;
[ $stop_vold -eq 1 ] && vxconfigd;

exit 0
