3 # ============================================================================
4 # Copyright (C) THALES. All rights reserved
5 # Author: Laurent Mazet
7 # ============================================================================
13 PROGNAME
=$
(basename $0)
19 echo "usage: $PROGNAME [-h] [-v] host"
20 echo " -h: help message"
21 echo " -v: version message"
27 function title
() { echo -e "\033[0;1m$*\033[0;0m"; }
28 function pass
() { echo -e "\033[1;32m$*\033[0;0m"; }
29 function warn
() { echo -e "\033[1;33m$*\033[0;0m"; }
30 function fail
() { echo -e "\033[1;31m$*\033[0;0m"; }
36 { eval $@
; } && pass OK ||
{ fail KO
; ERR
=yes; }
42 while [ $# -gt 0 ]; do
45 -v) echo "$PROGNAME: version $VER"; exit;;
51 # find master directory
53 mydir
=$
(cd $mydir; pwd)
55 MASTERREP
=$
(cd $mydir/..
/..
/..
; pwd)
56 [ -d $MASTERREP ] ||
{ echo "can't find master repository"; exit 1; }
59 [ "$HOST" ] ||
{ echo "Need a hosname/ip to synchronize master"; exit 1; }
62 check
chmod g-w
-R $MASTERREP
63 check
chmod go-rwx
$MASTERREP/root
/.
ssh
64 check
chmod go-rwx
$MASTERREP/root
/.ssh
/id_rsa
65 check
chmod go-rwx
$MASTERREP/opt
/cluster
/slave
/root
/.
ssh
66 check
chmod go-rwx
$MASTERREP/opt
/cluster
/slave
/root
/.ssh
/id_rsa
67 check
chmod a
+rwx
$MASTERREP/opt
/tftp
68 check rsync
-va --no-o --no-g ~
/debian6500
/master
/ root@
$HOST:/