Archived
1
0
Fork 0

Ready for deployement

This commit is contained in:
Mercier Pierre-Olivier 2013-09-15 14:39:56 +02:00
parent 34b72a4f4e
commit 2a79cf1e6a
2 changed files with 10 additions and 20 deletions

View file

@ -13,25 +13,15 @@ launch_screen()
CMD=$2
if [ -n "$3" ] && [ -f "$3" ]
then
CMD="source $3; $CMD"
TMP=`$SU -c 'mktemp' intradmin`
$SU -c "ssh-agent" intradmin > "$TMP"
$SU -c ". $TMP; ssh-add '$3'" intradmin
CMD=". $TMP; ssh-add -l; echo; $CMD"
fi
$SU -c "$SCREEN -S '$1' -d -m bash -c '$2'" intradmin
}
ask_ssh_key()
{
TMP=`mktemp`
ssh-agent > "$TMP"
. "$TMP" > /dev/null
chown intradmin "$TMP"
if ssh-add "$1"
then
chown intradmin "$SSH_AUTH_SOCK"
chown intradmin `dirname "$SSH_AUTH_SOCK"`
echo "$TMP"
fi
$SU -c "$SCREEN -S '$1' -d -m bash -c '$CMD'" intradmin
sleep 1
/bin/rm "$TMP"
}
if [ -z "$1" ]
@ -52,11 +42,11 @@ done
case $HOSTNAME in
cpp)
launch_screen "lerdorf_process_ldap_sync_ssh_keys_forge" "while true; do $PERL ~/liblerdorf/process/ldap/sync_ssh_keys_forge.pl; done" `ask_ssh_key "$HOME/.ssh/git"`
launch_screen "lerdorf_process_ldap_sync_ssh_keys_forge" "while true; do $PERL ~/liblerdorf/process/ldap/sync_ssh_keys_forge.pl; done" ~intradmin/.ssh/git
;;
hamano)
launch_screen "lerdorf_process_ldap_sync_ssh_keys_git" "while true; do $PERL ~/liblerdorf/process/ldap/sync_ssh_keys_git.pl; done" `ask_ssh_key "$HOME/.ssh/git"`
launch_screen "lerdorf_process_ldap_sync_ssh_keys_git" "while true; do $PERL ~/liblerdorf/process/ldap/sync_ssh_keys_git.pl; done" ~intradmin/.ssh/git
;;
moore)