Fix too much kill of ssh-agent
This commit is contained in:
parent
8a4b545da6
commit
de88e60fa5
1 changed files with 7 additions and 1 deletions
|
@ -12,13 +12,17 @@ else
|
||||||
fi
|
fi
|
||||||
PERL='/usr/bin/env perl'
|
PERL='/usr/bin/env perl'
|
||||||
|
|
||||||
|
reset_agents()
|
||||||
|
{
|
||||||
|
echo "killall ssh-agent" | $SU intradmin
|
||||||
|
}
|
||||||
|
|
||||||
launch_screen()
|
launch_screen()
|
||||||
{
|
{
|
||||||
CMD=$2
|
CMD=$2
|
||||||
if [ -n "$3" ] && [ -f "$3" ]
|
if [ -n "$3" ] && [ -f "$3" ]
|
||||||
then
|
then
|
||||||
TMP=`echo mktemp | $SU intradmin`
|
TMP=`echo mktemp | $SU intradmin`
|
||||||
echo "killall ssh-agent" | $SU intradmin
|
|
||||||
echo "ssh-agent" | $SU intradmin > "$TMP"
|
echo "ssh-agent" | $SU intradmin > "$TMP"
|
||||||
echo ". $TMP; ssh-add '$3'" | $SU intradmin
|
echo ". $TMP; ssh-add '$3'" | $SU intradmin
|
||||||
CMD=". $TMP; ssh-add -l; echo; $CMD"
|
CMD=". $TMP; ssh-add -l; echo; $CMD"
|
||||||
|
@ -80,10 +84,12 @@ then
|
||||||
case $HOSTNAME in
|
case $HOSTNAME in
|
||||||
|
|
||||||
cpp)
|
cpp)
|
||||||
|
reset_agents
|
||||||
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
|
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)
|
hamano)
|
||||||
|
reset_agents
|
||||||
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
|
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
|
||||||
launch_screen "lerdorf_process_send_git" "while true; do $PERL ~/liblerdorf/process/files/send_git.pl; done" ~intradmin/.ssh/git
|
launch_screen "lerdorf_process_send_git" "while true; do $PERL ~/liblerdorf/process/files/send_git.pl; done" ~intradmin/.ssh/git
|
||||||
;;
|
;;
|
||||||
|
|
Reference in a new issue