[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Configuration centralizing tool sought - yupp




On Sat, 1 Feb 2003, Miquel van Smoorenburg wrote:

> 
> There are not things you should package. It's a one-off that you,
> as a capable sysadmin ;), should be able to write in less time as
> it took for you to compose this message.

and i'd make the script check the Master release directory
and update tiself .. everytime the master version changed

master:/home/master/foo.rc
master:/home/master/foo.specificUSER.rc

test your customized changes ... and release to the release dir...
and each client updates itself automatically..

- i do that/this with most of my systems files...
	a script runs daily to update itself

	and/or a change can be forced for clients to update now
	( assumign the script is constantly running ) with a command says
	"wakeup" than the scripts will update itself w/o waiting for
	periodic cron updates

	lots o ways to skin the cat here

- pulling is better ... than pushing...:-)

	"apt-get  foo.rc"

c ya
alvin

> #! /bin/sh
> #
> # Usage: tool <backup dir> <config file> <user> [user ..]
> #
> DIR=$1
> RC=$2
> shift; shift

add code for check against the master and update yourself first if
needed/desired

> 
> for i in $*
> do
> 	HDIR=`eval echo ~$i`
> 	if [ -f $HDIR/$RC ]
> 	then
> 		if [ ! -d $DIR/$i ]
> 		then
> 			mkdir $DIR/$i
> 		fi

- add code for specific user version

> 		if [ ! -f $DIR/$i/$RC ]
> 		then
> 			cp -a $HDIR/$RC $DIR/$i
> 			echo "** User $i:"
> 			echo "== Initial copy of $HDIR/$RC to $DIR/$i .. OK"
> 		elif ! cmp -s $HDIR/$RC $DIR/$i/$RC
> 		then
> 			echo "** User $i:"
> 			echo "== $HDIR/$RC differs from backup $DIR/$i/$RC :"
> 			diff -u $DIR/$i $HDIR/$RC
> 			echo
> 			cp -a $HDIR/$RC $DIR/$i
> 		fi
> 	fi
> done | mail -s "Tool output" root
> 



Reply to: