123456789101112131415161718192021222324 |
- target="192.168.8.$1"
- echo "Mkdir /program on $target"
- ssh root@$target "mkdir -p /program;"
- echo "Copying files to $target"
- rsync -avzR --update --progress bin/ ./bin shell ./shell/ cfg/ ./cfg/ log/ ./log/ root@$target:/program/sta/
- if [ ! -z "$2" ];
- then
- echo "Deploying service"
- ssh root@$target "cd /program/sta/shell; ./service_deploy.sh $2"
- else
- echo "STA service is removed since 2023/12/18"
- ssh root@$target "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
|