Add integratin network support
authorThomas Pérennou (Viveris Technologie) <thomas.perennou@external.thalesgroup.com>
Wed, 11 Feb 2015 14:44:43 +0000 (15:44 +0100)
committerThomas Pérennou (Viveris Technologie) <thomas.perennou@external.thalesgroup.com>
Wed, 11 Feb 2015 14:44:43 +0000 (15:44 +0100)
master/opt/cluster/bin/sync_master.sh

index 08298ada615ab5081aeb10890b37ab7702149095..62936aa5652b03177d801841d4a15e1755bca1ee 100755 (executable)
@@ -65,6 +65,20 @@ check chmod go-rwx $MASTERREP/root/.ssh/id_rsa
 check chmod go-rwx $MASTERREP/opt/cluster/slave/root/.ssh
 check chmod go-rwx $MASTERREP/opt/cluster/slave/root/.ssh/id_rsa
 check chmod a+rwx $MASTERREP/opt/tftp
-check rsync -va --no-o --no-g ~/debian6500/master/ root@$HOST:/
+if [ "$(hostname)" = 'clovis53' ]; then
+    REMOTE_FS="root@$HOST:/"
+else
+    REMOTE_FS="/tmp/$USERNAME$$"
+    mkdir $REMOTE_FS
+    case "$HOST" in
+        alpha) SENSOR_PORT="2222";;
+        gamma) SENSOR_PORT="2224";;
+        clovis) SENSOR_PORT="2223";;
+        *) fail "Incorrect name of sensor"; exit 1;;
+    esac
+    sshfs -p $SENSOR_PORT root@clovis53:/ $REMOTE_FS
+fi
+check rsync -va --no-o --no-g $MASTERREP/ $REMOTE_FS
+fusermount -u $REMOTE_FS 2>/dev/null && rmdir $REMOTE_FS
 
 exit 0