#!/bin/bash TARGET=coriolis%gwelic touch $HOME/.Xauthority mkdir $HOME/.ssh 2> /dev/null [ -s $HOME/.ssh/config ] && mv $HOME/.ssh/config $HOME/.ssh/config_old [ ! -s $HOME/.ssh/id_rsa.ceci ] && echo "Create a CECI account and put your 'id_rsa.ceci' file in $HOME/.ssh !" [ ! -s $HOME/.ssh/id_rsa.ceci ] && exit chmod 600 $HOME/.ssh/id_rsa.ceci [ ! -s $HOME/.ssh/id_rsa.ceci.pub ] && ssh-keygen -y -f $HOME/.ssh/id_rsa.ceci > $HOME/.ssh/id_rsa.ceci.pub cat station_config | sed -e 's/jsmith/'$USER'/g' > $HOME/.ssh/config ssh-copy-id -i $HOME/.ssh/id_rsa.ceci gwelic #2> /dev/null ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null ssh -q -o BatchMode=yes $TARGET exit if [ $? != "0" ]; then echo "Installation failed" exit fi scp ./install_elic.sh ./elic_config $TARGET:~ scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh ssh -q -o BatchMode=yes $TARGET bash ./install_elic.sh ssh -q -o BatchMode=yes $TARGET rm -f ./install_elic.sh ./elic_config TARGET=manneback ssh-copy-id -i $HOME/.ssh/id_rsa.ceci gwcism #2> /dev/null ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null scp ./install_ceci.sh ./ceci_config $TARGET:~ scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config TARGET=lemaitre3 ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null scp ./install_ceci.sh ./ceci_config $TARGET:~ scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config TARGET=zenobe ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null scp ./install_ceci.sh ./ceci_config $TARGET:~ scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config echo -e "\nInstallation done.\n"