1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 20:01:56 +00:00
srs/trunk/scripts/csdn.mirror.sh

38 lines
846 B
Bash
Raw Normal View History

2014-03-30 10:41:46 +00:00
#!/bin/bash
echo "更新CSDN镜像的脚本"
echo "argv[0]=$0"
if [[ ! -f $0 ]]; then
echo "directly execute the scripts on shell.";
work_dir=`pwd`
else
echo "execute scripts in file: $0";
work_dir=`dirname $0`; work_dir=`(cd ${work_dir} && pwd)`
fi
work_dir=`(cd ${work_dir}/.. && pwd)`
product_dir=$work_dir
2014-04-18 00:57:36 +00:00
# allow start script from any dir
cd $work_dir && git checkout master
2014-04-18 00:57:36 +00:00
2014-03-30 10:41:46 +00:00
. ${product_dir}/scripts/_log.sh
ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
ok_msg "导入脚本成功"
2014-10-27 04:03:56 +00:00
source $work_dir/scripts/_mirror.utils.sh
2014-03-30 10:58:17 +00:00
git remote -v|grep code.csdn.net >/dev/null 2>&1
ret=$?; if [[ 0 -ne $ret ]]; then
2014-10-27 04:03:56 +00:00
first_checkout "CSDN" \
"git@code.csdn.net:winlinvip/srs-csdn.git" \
"srs-csdn" "$work_dir/scripts/csdn.mirror.sh"
exit 0;
fi
2014-03-30 10:58:17 +00:00
2014-10-27 04:03:56 +00:00
sync_master
sync_1_0_release
sync_push "CSDN"
2014-03-30 10:41:46 +00:00
exit 0