# Handle the incoming configuration files:
config() {
  for infile in $1; do
    NEW="$infile"
    OLD="`dirname $NEW`/`basename $NEW .new`"
    # If there's no config file by that name, mv it over:
    if [ ! -r $OLD ]; then
      mv $NEW $OLD
    elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
      # toss the redundant copy
      rm $NEW
    fi
    # Otherwise, we leave the .new copy for the admin to consider...
  done
}

config etc/ffserver.conf.new


( cd usr/lib ; rm -rf libpostproc.so )
( cd usr/lib ; ln -sf libpostproc.so.51.2.0 libpostproc.so )
( cd usr/lib ; rm -rf libavcodec.so.53 )
( cd usr/lib ; ln -sf libavcodec.so.53.42.0 libavcodec.so.53 )
( cd usr/lib ; rm -rf libavdevice.so.53 )
( cd usr/lib ; ln -sf libavdevice.so.53.4.0 libavdevice.so.53 )
( cd usr/lib ; rm -rf libavdevice.so )
( cd usr/lib ; ln -sf libavdevice.so.53.4.0 libavdevice.so )
( cd usr/lib ; rm -rf libavutil.so.51 )
( cd usr/lib ; ln -sf libavutil.so.51.32.0 libavutil.so.51 )
( cd usr/lib ; rm -rf libswresample.so )
( cd usr/lib ; ln -sf libswresample.so.0.5.0 libswresample.so )
( cd usr/lib ; rm -rf libswscale.so )
( cd usr/lib ; ln -sf libswscale.so.2.1.0 libswscale.so )
( cd usr/lib ; rm -rf libavutil.so )
( cd usr/lib ; ln -sf libavutil.so.51.32.0 libavutil.so )
( cd usr/lib ; rm -rf libswresample.so.0 )
( cd usr/lib ; ln -sf libswresample.so.0.5.0 libswresample.so.0 )
( cd usr/lib ; rm -rf libavfilter.so.2 )
( cd usr/lib ; ln -sf libavfilter.so.2.53.0 libavfilter.so.2 )
( cd usr/lib ; rm -rf libavformat.so.53 )
( cd usr/lib ; ln -sf libavformat.so.53.24.0 libavformat.so.53 )
( cd usr/lib ; rm -rf libavformat.so )
( cd usr/lib ; ln -sf libavformat.so.53.24.0 libavformat.so )
( cd usr/lib ; rm -rf libpostproc.so.51 )
( cd usr/lib ; ln -sf libpostproc.so.51.2.0 libpostproc.so.51 )
( cd usr/lib ; rm -rf libavcodec.so )
( cd usr/lib ; ln -sf libavcodec.so.53.42.0 libavcodec.so )
( cd usr/lib ; rm -rf libavfilter.so )
( cd usr/lib ; ln -sf libavfilter.so.2.53.0 libavfilter.so )
( cd usr/lib ; rm -rf libswscale.so.2 )
( cd usr/lib ; ln -sf libswscale.so.2.1.0 libswscale.so.2 )
