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