New deployment script
This commit is contained in:
parent
01e0f10c38
commit
639c73a4cf
2 changed files with 17 additions and 12 deletions
3
Makefile
3
Makefile
|
@ -7,10 +7,9 @@ PROVER=prove -f
|
||||||
RM=rm
|
RM=rm
|
||||||
TESTDIR=t
|
TESTDIR=t
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/sh
|
||||||
SU=/bin/su
|
|
||||||
|
|
||||||
launch:
|
launch:
|
||||||
$(SU) -s /bin/sh -c "$(SHELL) process/launch.sh" intradmin
|
$(SHELL) ./process/launch.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
$(SHELL) commands/first-install.sh
|
$(SHELL) commands/first-install.sh
|
||||||
|
|
|
@ -5,8 +5,14 @@ cd $(dirname "$0")
|
||||||
GREP='/bin/egrep'
|
GREP='/bin/egrep'
|
||||||
SCREEN='/usr/bin/screen'
|
SCREEN='/usr/bin/screen'
|
||||||
SED='/bin/sed -E'
|
SED='/bin/sed -E'
|
||||||
|
SU='/bin/su -s /bin/sh'
|
||||||
PERL='/usr/bin/env perl'
|
PERL='/usr/bin/env perl'
|
||||||
|
|
||||||
|
launch_screen()
|
||||||
|
{
|
||||||
|
$SU -c "$SCREEN -S '$1' -d -m bash -c '$2'" intradmin
|
||||||
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
then
|
then
|
||||||
HOSTNAME=`/bin/hostname`
|
HOSTNAME=`/bin/hostname`
|
||||||
|
@ -15,34 +21,34 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kill old liblersorf screen sessions
|
# Kill old liblersorf screen sessions
|
||||||
$SCREEN -ls | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
|
$SU -c "$SCREEN -ls" intradmin | $GREP '[0-9]+\.lerdorf_[a-zA-Z0-9_-]+' |
|
||||||
while read LINE
|
while read LINE
|
||||||
do
|
do
|
||||||
SNAME=`echo $LINE | $SED "s/^[^0-9]*([0-9]+\.[^ \t]+).*$/\1/"`
|
SNAME=`echo $LINE | $SED "s/^[^0-9]*([0-9]+\.[^ \t]+).*$/\1/"`
|
||||||
$SCREEN -S "$SNAME" -X kill
|
$SU -c "$SCREEN -S \"$SNAME\" -X kill" intradmin
|
||||||
done
|
done
|
||||||
|
|
||||||
case $HOSTNAME in
|
case $HOSTNAME in
|
||||||
|
|
||||||
cpp)
|
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"
|
launch_screen "lerdorf_process_ldap_sync_ssh_keys_forge" "while true; do $PERL process/ldap/sync_ssh_keys_forge.pl; done"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
hamano)
|
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"
|
launch_screen "lerdorf_process_ldap_sync_ssh_keys_git" "while true; do $PERL process/ldap/sync_ssh_keys_git.pl; done"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
moore)
|
moore)
|
||||||
$SCREEN -S lerdorf_process_ldap_check_ssh_key -d -m bash -c "while true; do $PERL process/ldap/check_ssh_key.pl; done"
|
launch_screen "lerdorf_process_ldap_check_ssh_key" "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"
|
launch_screen "lerdorf_process_ldap_sync_ssh_keys" "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"
|
launch_screen "lerdorf_process_ldap_update_group" "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"
|
launch_screen "lerdorf_process_ldap_update_user" "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"
|
launch_screen "lerdorf_process_files_intradata_get" "while true; do $PERL process/files/intradata_get.pl; done"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
noyce)
|
noyce)
|
||||||
$SCREEN -S lerdorf_process_files_intradata_get -d -m bash -c "while true; do $PERL process/files/intradata_get.pl; done"
|
launch_screen "lerdorf_process_files_intradata_get" "while true; do $PERL process/files/intradata_get.pl; done"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
Reference in a new issue