1234567891011121314151617181920212223 |
- # 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 "Creating /program directory on 10.8.0.$1 192.168.8.$2"
- ssh -p 60$2 root@10.8.0.$1 "mkdir -p /program;"
- echo "Copying files to 10.8.0.$1 192.168.8.$2"
- rsync -e 'ssh -p 60'$2 -avzR --update --progress bin/ ./bin data/ ./data/ shell ./shell/ cfg/ ./cfg/ root@10.8.0.$1:/program/ctnd/
- if [ ! -z "$3" ];
- then
- echo "Deploying service"
- ssh -p 60$2 root@10.8.0.$1 "cd /program/ctnd/shell; ./service_deploy.sh $3; ./clean_local.sh;"
- else
- read -p "Restart ctnd (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 "ctnd not restarted"
- fi
- fi
|