Attached is a new XFree86-lib.sh. Changes:
1.) Don't accidentally try to move directories that have already been
moved.
2.) Clean up bad links left by previous scripts.
3.) Comments and better readability.
Sorry about the previous one. It was not properly tested.
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax: 314-551-8444
#!/bin/sh
Xconfig=/usr/X11R6/lib/X11 # obsolete base dir
etcXconfig=/etc/X11 # new base dir
mkdir -p $etcXconfig # assure new base dir exists
# subdirs to move
subconfigs="app-defaults fs lbxproxy proxymngr rstart twm xdm xinit xsm xserver"
for dir in $subconfigs; do
Xdir=$Xconfig/$dir # obsolete subdir
etcXdir=$etcXconfig/$dir # new subdir
mkdir -p $etcXdir # assure new subdir exists
# Move to new location if not already there
if test ! -L $Xdir && test -d $Xdir; then
tar -cf - -C $Xdir . | tar -xvpUf - -C $etcXdir && \
rm -rf $Xdir
fi
ln -sf $etcXdir $Xconfig/ # assure compatibility link exists
# Clean up bad links left from old/buggy scripts
if test -L $Xdir/$dir; then
rm -f $Xdir/$dir
fi
done