From 48cf3adb7abfd48e2976fbe8aba3130dbd9b4f25 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Sat, 17 Sep 2011 00:09:06 -0700 Subject: [PATCH 1/3] fix fallback pub key transfer mechanism The fallback mechanism for transfering the public key to the server used id_rsa.pub on the client (when it creates id_dsa.pub) and copies it to id_dsa.pub on the server, instead of appending to authorized_keys as ssh-copy-id would do. Use id_dsa.pub and append to authorized_keys. Signed-off-by: Darren Hart --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 73f9af7..c960ab1 100755 --- a/install.sh +++ b/install.sh @@ -104,7 +104,7 @@ ssh.keygen(){ exit 1 fi else - su ${username} -c "cat /home/${username}/.ssh/id_rsa.pub | ssh $remote_server -p ${port} 'cat - > /home/${username}/.ssh/id_dsa.pub'" >> /dev/null + su ${username} -c "cat /home/${username}/.ssh/id_dsa.pub | ssh $remote_server -p ${port} 'cat - >> /home/${username}/.ssh/authorized_keys'" >> /dev/null if [ $? -eq 0 ]; then X=0 #echo "done" else From a624835a7b71178b7940ebf9d743c4525a5299d2 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Sat, 17 Sep 2011 00:24:41 -0700 Subject: [PATCH 2/3] Correct local/remote directory references Both the install script and the installed lipsync script use "$REMOTE_HOST:REMOTE_DIR $LOCAL_DIR" which results in an rsync error if different paths are used on the client and server. Correct this. Signed-off-by: Darren Hart --- bin/lipsync | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/lipsync b/bin/lipsync index baac62b..9b48402 100644 --- a/bin/lipsync +++ b/bin/lipsync @@ -45,7 +45,7 @@ fi # run the rsync command to check server for updated files ############### #/usr/bin/rsync $@ || err=$? -rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$LOCAL_DIR $REMOTE_DIR +rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$REMOTE_DIR $LOCAL_DIR ############### # this writes source -> destination details to lipsyncd.log diff --git a/install.sh b/install.sh index c960ab1..a5870ab 100755 --- a/install.sh +++ b/install.sh @@ -195,7 +195,7 @@ deploy(){ initial_sync(){ echo -n "* Doing inital sync with server..." . /etc/lipsyncd - su $USER_NAME -c 'rsync -rav --stats --log-file=/home/'$USER_NAME'/.lipsyncd/lipsyncd.log -e "ssh -l '$USER_NAME' -p '$SSH_PORT'" '$REMOTE_HOST':'$LOCAL_DIR' '$REMOTE_DIR'' + su $USER_NAME -c 'rsync -rav --stats --log-file=/home/'$USER_NAME'/.lipsyncd/lipsyncd.log -e "ssh -l '$USER_NAME' -p '$SSH_PORT'" '$REMOTE_HOST':'$REMOTE_DIR' '$LOCAL_DIR'' echo "Initial sync `date` Completed" > /home/$username/.lipsyncd/lipsyncd.log } From 5b96d92a4d13ef491937de9a5adbf95070dc1e82 Mon Sep 17 00:00:00 2001 From: ka2er Date: Mon, 19 Sep 2011 22:25:27 +0200 Subject: [PATCH 3/3] running cron 1 time/5minutes is better ... --- etc/cron.d/lipsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/cron.d/lipsync b/etc/cron.d/lipsync index a0b1735..5d07653 100644 --- a/etc/cron.d/lipsync +++ b/etc/cron.d/lipsync @@ -1 +1 @@ -* * * * * /usr/local/bin/lipsync +5/* * * * * /usr/local/bin/lipsync