-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_old
72 lines (64 loc) · 2.24 KB
/
build_old
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
case $1 in
dashboard)
wget https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip
unzip gh-pages.zip
rm -rf koolclash/webs/koolclash && mkdir -p koolclash/webs/koolclash
cp -rf clash-dashboard-gh-pages/* koolclash/webs/koolclash
rm -rf gh-pages.zip
rm -rf clash-dashboard-gh-pages
echo '----------------------------------------'
echo 'Update to latest clash-dashboard'
echo '----------------------------------------'
;;
pack)
mkdir -p koolclash-build/koolclash
cp -rf koolclash/* koolclash-build/koolclash
cd koolclash-build
#upx=$(which upx)
#
#if [ "x$upx" != "x" ] && [ -x $upx ]; then
# upx ./koolclash/bin/*
#else
# echo '----------------------------------------'
# echo "You should install upx first!"
# echo '----------------------------------------'
# exit 1
#fi
tar zcvf ../koolclash.tar.gz koolclash
cd ..
mkdir -p koolclash-build/fuckkoolshare
cp -rf fuckkoolshare/* koolclash-build/fuckkoolshare
cd koolclash-build
tar zcvf ../fuckkoolshare.tar.gz fuckkoolshare
cd ..
rm -rf koolclash-build
echo '----------------------------------------'
echo 'Build the latest version'
echo '----------------------------------------'
;;
ipdb)
wget https://static.clash.to/GeoIP2/GeoIP2-Country.tar.gz -O ipdb.tar.gz
mkdir -p geolite
tar zxvf ipdb.tar.gz -C geolite
chmod 644 geolite/GeoIP2-Country_*/*
version=$(ls geolite | grep 'GeoIP2-Country' | sed "s|GeoIP2-Country_||g")
cp -rf geolite/GeoIP2-Country_*/GeoIP2-Country.mmdb koolclash/koolclash/config/Country.mmdb
rm -rf ipdb.tar.gz
rm -rf geolite
echo '----------------------------------------'
echo "Update the ipdb to $version"
echo '----------------------------------------'
;;
*)
echo '=================================================='
echo ' KoolClash Build Tools'
echo '--------------------------------------------------'
echo 'Usage: build [option]'
echo ''
echo "dashboard\tUpdate clash-dashboard to latest"
echo "ipdb\t\tUpdate GeoLite to latest"
echo "pack\t\tBuild the package"
echo '=================================================='
;;
esac