forked from user1121114685/koolproxyR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sh
More file actions
executable file
·26 lines (21 loc) · 803 Bytes
/
backup.sh
File metadata and controls
executable file
·26 lines (21 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh
# you can do something here
# this shell scripts will run at the end of build.py scripts
tar_name="$1.tar.gz"
mkdir -p history
if [ ! -f ./history/version ]; then
touch ./history/version
fi
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
version_new=`cat config.json.js | grep "version"|cut -d"\"" -f 4`
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
md5_new=` md5sum $tar_name | awk '{print $1}'`
# 保证md5连续性
wget -O ./history/version https://dev.tencent.com/u/shaoxia1991/p/koolproxyr/git/raw/master/history/version
if [ -f ./$tar_name ]; then
if [ "$version_old" != "$version_new" ]; then
mkdir ./history/$version_new/
cp ./$tar_name ./history/$version_new/
echo $version_new $md5_new >> ./history/version
fi
fi