deploy.sh 919 B

12345678910111213141516171819202122232425
  1. # nohup socat -v tcp-listen:12345,fork,reuseaddr tcp:192.168.0.137:22 &
  2. # rsync -e `ssh -p 60$2` -avR --delete --progress bin/ ./bin data/ ./data/ shell ./shell/ cfg/ ./cfg/ root@10.8.0.$1:/program/ctnd/
  3. echo "mkdir /program on 10.8.0.$1"
  4. ssh root@10.8.0.$1 "mkdir -p /program;"
  5. echo "Copying files to 10.8.0.$1"
  6. rsync -avzR --update --progress bin/ ./bin shell ./shell/ cfg/ ./cfg/ log/ ./log/ root@10.8.0.$1:/program/sta/
  7. if [ ! -z "$2" ];
  8. then
  9. echo "Deploying service"
  10. ssh root@10.8.0.$1 "cd /program/sta/shell; ./service_deploy.sh $2"
  11. else
  12. echo "STA service is removed since 2023/12/18"
  13. ssh root@10.8.0.$1 "cd /program/sta/shell; ./service_deploy.sh"
  14. # read -p "Restart sta (YyNn) ? " -n 1 -r
  15. # echo # (optional) move to a new line
  16. # if [[ $REPLY =~ ^[Yy]$ ]]
  17. # then
  18. # ssh root@10.8.0.$1 "systemctl restart sta"
  19. # else
  20. # echo "STA not restarted"
  21. # fi
  22. fi