deploy_local.sh 725 B

123456789101112131415161718192021222324
  1. target="192.168.8.$1"
  2. echo "Mkdir /program on $target"
  3. ssh root@$target "mkdir -p /program;"
  4. echo "Copying files to $target"
  5. rsync -avzR --update --progress bin/ ./bin shell ./shell/ cfg/ ./cfg/ log/ ./log/ root@$target:/program/sta/
  6. if [ ! -z "$2" ];
  7. then
  8. echo "Deploying service"
  9. ssh root@$target "cd /program/sta/shell; ./service_deploy.sh $2"
  10. else
  11. echo "STA service is removed since 2023/12/18"
  12. ssh root@$target "cd /program/sta/shell; ./service_deploy.sh"
  13. # read -p "Restart sta (YyNn) ? " -n 1 -r
  14. # echo # (optional) move to a new line
  15. # if [[ $REPLY =~ ^[Yy]$ ]]
  16. # then
  17. # ssh root@10.8.0.$1 "systemctl restart sta"
  18. # else
  19. # echo "STA not restarted"
  20. # fi
  21. fi