update_server

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/bash

abbr=$1
update_server=$2

ssh_port=3929

if [ -z $abbr ]
then
    echo $abbr
    echo 参数不对
    exit
fi
if [ -z $update_server ]
then
    echo $update_server
    echo 参数不对
    exit
fi
update_path=/opt/update

[[ -d $update_path ]] || mkdir $update_path
if [ $abbr != AVP ]
then
    rsync -avzr -e "ssh -p $ssh_port" --delete --include=$abbr --exclude=finished/* rsync@$update_server:/opt/download/update/finished $update_path
    while ! [[ -e $update_path/finished/$abbr ]]
    do
    	sleep 3
    	rsync -avzr -e "ssh -p $ssh_port" --delete --include=$abbr --exclude=finished/* rsync@$update_server:/opt/download/update/finished $update_path
    done
fi
fin_path=/dev/shm/update/finished
[[ -d $fin_path ]] || mkdir -p $fin_path
[[ -e $fin_path/$abbr ]] && rm -f $fin_path/$abbr

engine_update=$abbr"Update"
echo rsync -avzr -e "ssh -p $ssh_port" --delete --exclude=.git  rsync@$update_server:/opt/download/update/$engine_update $update_path
rsync -avzr -e "ssh -p $ssh_port" --delete --exclude=.git  rsync@$update_server:/opt/download/update/$engine_update $update_path
rsync -av $update_path/$mem_update /dev/shm/update
[[ -e $fin_path/$abbr ]] || touch $fin_path/$abbr