install.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. TARGET=coriolis%gwelic
  3. touch $HOME/.Xauthority
  4. mkdir $HOME/.ssh 2> /dev/null
  5. [ -s $HOME/.ssh/config ] && mv $HOME/.ssh/config $HOME/.ssh/config_old
  6. [ ! -s $HOME/.ssh/id_rsa.ceci ] && echo "Create a CECI account and put your 'id_rsa.ceci' file in $HOME/.ssh !"
  7. [ ! -s $HOME/.ssh/id_rsa.ceci ] && exit
  8. chmod 600 $HOME/.ssh/id_rsa.ceci
  9. [ ! -s $HOME/.ssh/id_rsa.ceci.pub ] && ssh-keygen -y -f $HOME/.ssh/id_rsa.ceci > $HOME/.ssh/id_rsa.ceci.pub
  10. cat station_config | sed -e 's/jsmith/'$USER'/g' > $HOME/.ssh/config
  11. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci gwelic #2> /dev/null
  12. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null
  13. ssh -q -o BatchMode=yes $TARGET exit
  14. if [ $? != "0" ]; then
  15. echo "Installation failed"
  16. exit
  17. fi
  18. scp ./install_elic.sh ./elic_config $TARGET:~
  19. scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh
  20. ssh -q -o BatchMode=yes $TARGET bash ./install_elic.sh
  21. ssh -q -o BatchMode=yes $TARGET rm -f ./install_elic.sh ./elic_config
  22. TARGET=manneback
  23. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci gwcism #2> /dev/null
  24. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null
  25. scp ./install_ceci.sh ./ceci_config $TARGET:~
  26. scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh
  27. ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh
  28. ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config
  29. TARGET=lemaitre3
  30. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null
  31. scp ./install_ceci.sh ./ceci_config $TARGET:~
  32. scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh
  33. ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh
  34. ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config
  35. TARGET=zenobe
  36. ssh-copy-id -i $HOME/.ssh/id_rsa.ceci $TARGET #2> /dev/null
  37. scp ./install_ceci.sh ./ceci_config $TARGET:~
  38. scp $HOME/.ssh/id_rsa.ceci $HOME/.ssh/id_rsa.ceci.pub $TARGET:~/.ssh
  39. ssh -q -o BatchMode=yes $TARGET bash ./install_ceci.sh
  40. ssh -q -o BatchMode=yes $TARGET rm -f ./install_ceci.sh ./ceci_config
  41. echo -e "\nInstallation done.\n"