#!/bin/sh # (c) Copyright 2002, 2003 Stichting Wireless Leiden, all # rights reserved. More information can be found on # http://wwww.wirelessleiden.nl and the license is at: # http://wleiden.webweaving.org:8080/svn/node-config/LICENSE # # mvn 29-1-03 # replace configs from /etc/ and /usr/local/etc from symlinks from svn #vars svnb="/usr/svn" datum=`date "+%Y-%m-%d_%H:%M:%S"` bak="/tmp/backup/${datum}" dirlist="root" ### CHECKs ### cd $svnb if [ ! -d .svn ] ; then exit 1; fi if [ ! -d ${bak} ] ; then mkdir -p ${bak} ; fi cd root ### JOB ### cd ${svnb}/$dirlist || exit 1 for i in `find .` do case $i in *.svn*) ;; *) eval cd / # if there is a dir in /svn and # it is not in / then make it !! if [ -d ${svnb}/${dirlist}/${i} ] ; then cd / if [ ! -d ${i} ] ; then mkdir ${i} echo echo made dir ${i} fi fi # if there is file in /svn then look # for an original file make a backup # and replace it for a link to /svn if [ ! -d ${svnb}/${dirlist}/${i} ] ; then if [ -e ${i} ] ; then mv ${i} $bak echo echo backing up ${i} fi echo ln -fs ${svnb}/${dirlist}/${i} ${i} echo echo making symlink ${svnb}/${dirlist}/${i} ${i} echo fi ;; esac done echo done... exit