# 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 libswresample.so.2 )
( cd usr/lib ; ln -sf libswresample.so.2.9.100 libswresample.so.2 )
( cd usr/lib ; rm -rf libavresample.so )
( cd usr/lib ; ln -sf libavresample.so.3.7.0 libavresample.so )
( cd usr/lib ; rm -rf libpostproc.so.54 )
( cd usr/lib ; ln -sf libpostproc.so.54.7.100 libpostproc.so.54 )
( cd usr/lib ; rm -rf libpostproc.so )
( cd usr/lib ; ln -sf libpostproc.so.54.7.100 libpostproc.so )
( cd usr/lib ; rm -rf libavdevice.so.57 )
( cd usr/lib ; ln -sf libavdevice.so.57.10.100 libavdevice.so.57 )
( cd usr/lib ; rm -rf libswscale.so )
( cd usr/lib ; ln -sf libswscale.so.4.8.100 libswscale.so )
( cd usr/lib ; rm -rf libavfilter.so )
( cd usr/lib ; ln -sf libavfilter.so.6.107.100 libavfilter.so )
( cd usr/lib ; rm -rf libavutil.so.55 )
( cd usr/lib ; ln -sf libavutil.so.55.78.100 libavutil.so.55 )
( cd usr/lib ; rm -rf libavutil.so )
( cd usr/lib ; ln -sf libavutil.so.55.78.100 libavutil.so )
( cd usr/lib ; rm -rf libavformat.so.57 )
( cd usr/lib ; ln -sf libavformat.so.57.83.100 libavformat.so.57 )
( cd usr/lib ; rm -rf libavdevice.so )
( cd usr/lib ; ln -sf libavdevice.so.57.10.100 libavdevice.so )
( cd usr/lib ; rm -rf libswresample.so )
( cd usr/lib ; ln -sf libswresample.so.2.9.100 libswresample.so )
( cd usr/lib ; rm -rf libavcodec.so.57 )
( cd usr/lib ; ln -sf libavcodec.so.57.107.100 libavcodec.so.57 )
( cd usr/lib ; rm -rf libavformat.so )
( cd usr/lib ; ln -sf libavformat.so.57.83.100 libavformat.so )
( cd usr/lib ; rm -rf libavresample.so.3 )
( cd usr/lib ; ln -sf libavresample.so.3.7.0 libavresample.so.3 )
( cd usr/lib ; rm -rf libavfilter.so.6 )
( cd usr/lib ; ln -sf libavfilter.so.6.107.100 libavfilter.so.6 )
( cd usr/lib ; rm -rf libavcodec.so )
( cd usr/lib ; ln -sf libavcodec.so.57.107.100 libavcodec.so )
( cd usr/lib ; rm -rf libswscale.so.4 )
( cd usr/lib ; ln -sf libswscale.so.4.8.100 libswscale.so.4 )
