Skip to content

Commit

Permalink
some fixes, end to end testing brought to light. getting smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
philcryer committed Oct 23, 2010
1 parent 5454ec6 commit 493f0e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion etc/lipsyncd.conf.xml
Expand Up @@ -62,7 +62,7 @@ This is a default config file template for lsyncd.

<directory>
<source path="LSLOCDIR"/>
<target path="LSREMSERV::LSREMDIR"/>
<target path="ssh://LSREMSERV://LSREMDIR/"/>
<!--
or it can also be an absolute path for localhost
<target path="/absolute/path/to/target">
Expand Down
23 changes: 15 additions & 8 deletions setup.sh
Expand Up @@ -88,7 +88,11 @@ ssh.keygen(){

echo "* Transferring ssh key for ${username} to ${remote_server} (login as $username now)...";
#echo -n " NOTE: you will be prompted to login..."
su ${username} -c "ssh-copy-id ${remote_server}" >> /dev/null
#su ${username} -c "ssh-copy-id ${remote_server}" >> /dev/null

# ssh-copy-id -i id_rsa.pub terry@host2
su ${username} -c "ssh-copy-id -i /home/${username}/.ssh/id_dsa.pub ${username}@${remote_server}" >> /dev/null

# ssh-copy-id ${remote_server}
if [ $? -eq 0 ]; then
X=0 #echo "done"
Expand All @@ -97,7 +101,7 @@ ssh.keygen(){
fi
echo -n "* Setting permissions on the ssh key for ${username} on ${remote_server}...";
#echo -n " NOTE: you should not be prompted to login..."
su ${username} -c "ssh ${remote_server} 'chmod 700 .ssh'"
su ${username} -c "SSH_AUTH_SOCK=0 ssh ${remote_server} 'chmod 700 .ssh'"
#ssh ${remote_server} 'chmod 700 .ssh'
if [ $? -eq 0 ]; then
echo "done"
Expand Down Expand Up @@ -133,7 +137,8 @@ build.conf(){
sed 's|LSLOCDIR|'$lipsync_dir_local/'|g' etc/lipsyncd.conf.xml > /tmp/lipsyncd.conf.xml.01
sed 's|LSUSER|'$username'|g' /tmp/lipsyncd.conf.xml.01 > /tmp/lipsyncd.conf.xml.02
#sed 's|PORT|'$port'|g' /tmp/lipsyncd.conf.xml.02 > /tmp/lipsyncd.conf.xml.03
sed 's|LSREMSERV::LSREMDIR/|'ssh://$remote_server://$lipsync_dir_remote/'|g' /tmp/lipsyncd.conf.xml.02 > /tmp/lipsyncd.conf.xml
sed 's|LSREMSERV|'$remote_server'|g' /tmp/lipsyncd.conf.xml.02 > /tmp/lipsyncd.conf.xml.03
sed 's|LSREMDIR|'$lipsync_dir_remote'|g' /tmp/lipsyncd.conf.xml.03 > /tmp/lipsyncd.conf.xml
echo "done"
}

Expand Down Expand Up @@ -174,7 +179,7 @@ deploy(){
########################
echo -n " > installing docs /usr/share/doc/lipsync..."
mkdir /usr/share/doc/lipsync
cp README INSTALL LICENSE /usr/share/doc/lipsync
cp README* INSTALL* LICENSE /usr/share/doc/lipsync
echo "done"
########################
echo -n " > preparing logfile /var/log/lipsyncd.log..."
Expand All @@ -186,12 +191,14 @@ deploy(){
########################
echo -n " > enabling unison for $username..."
sed 's|LSLOCDIR|'$lipsync_dir_local/'|g' unison/lipsync.prf > /tmp/lipsync.prf.01
sed 's|LSUSER|'$username'|g' /tmp/lipsync.prf.01 > /tmp/lipsync.prf.02
sed 's|LSUSER|'${username}'|g' /tmp/lipsync.prf.01 > /tmp/lipsync.prf.02
sed 's|LSREMDIR|'$lipsync_dir_remote'|g' /tmp/lipsync.prf.02 > /tmp/lipsync.prf.03
sed 's|LSREMSERV|'$remote_server'|g' /tmp/lipsync.prf.03 > /tmp/lipsync.prf
mkdir ~/$username/.unison
cp /tmp/lipsync.prf ~/$username/.unison/
chown -R $username:$username ~/$username/.unison/
if [ ! -d "/home/${username}/.unison" ]; then
mkdir /home/${username}/.unison
fi
cp /tmp/lipsync.prf /home/${username}/.unison/
chown -R ${username}:${username} /home/${username}/.unison/
rm /tmp/lipsync.*
echo "done"
########################
Expand Down

0 comments on commit 493f0e3

Please sign in to comment.