Archived
1
0

Add a script to launch screens on each server

This commit is contained in:
Mercier Pierre-Olivier 2013-09-14 09:37:22 +02:00
parent 580564e358
commit 82789d394f
2 changed files with 56 additions and 0 deletions

View File

@ -5,6 +5,10 @@ MAKEDIR=mkdir
PROVER=prove -f
RM=rm
TESTDIR=t
SHELL=/bin/sh
launch:
$(SHELL) process/launch.sh
install:
$(MAKEDIR) -p $(DEST)

52
process/launch.sh Executable file
View File

@ -0,0 +1,52 @@
#! /bin/sh
cd $(dirname "$0")
GREP='/bin/egrep'
SCREEN='/usr/bin/screen'
SED='/bin/sed -E'
PERL='/usr/bin/env perl'
if [ -z "$1" ]
then
HOSTNAME="$1"
else
HOSTNAME=`/bin/hostname`
fi
# Kill old liblersorf screen sessions
$SCREEN -ls | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
while read LINE
do
SNAME=`echo $LINE | $SED "s/^[^0-9]*([0-9]+\.[^ \t]+).*$/\1/"`
$SCREEN -S "$SNAME" -X kill
done
case $HOSTNAME in
cpp)
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys_forge -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys_forge.pl; done"
;;
hamano)
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys_git -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys_git.pl; done"
;;
moore)
$SCREEN -S lerdorf_process_ldap_check_ssh_key -d -m bash -c "while true; do $PERL process/ldap/check_ssh_key.pl; done"
$SCREEN -S lerdorf_process_ldap_sync_ssh_keys -d -m bash -c "while true; do $PERL process/ldap/sync_ssh_keys.pl; done"
$SCREEN -S lerdorf_process_ldap_update_group -d -m bash -c "while true; do $PERL process/ldap/update_group.pl; done"
$SCREEN -S lerdorf_process_ldap_update_user -d -m bash -c "while true; do $PERL process/ldap/update_user.pl; done"
$SCREEN -S lerdorf_process_files_intradata_get -d -m bash -c "while true; do $PERL process/files/intradata_get.pl; done"
;;
noyce)
$SCREEN -S lerdorf_process_files_intradata_get -d -m bash -c "while true; do $PERL process/files/intradata_get.pl; done"
;;
*)
echo "No process to launch for $HOSTNAME" >&2
exit 1
;;
esac