fix bug and add update dat file

This commit is contained in:
233boy
2024-06-10 16:11:33 +08:00
parent 4d1279d038
commit f75e3f1187
9 changed files with 74 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ get_latest_version() {
}
download() {
latest_ver=$2
[[ ! $latest_ver ]] && get_latest_version $1
[[ ! $latest_ver && $1 != 'dat' ]] && get_latest_version $1
# tmp dir
tmpdir=$(mktemp -u)
[[ ! $tmpdir ]] && {
@@ -45,6 +45,17 @@ download() {
unzip -qo $tmpfile -d $is_sh_dir
chmod +x $is_sh_bin
;;
dat)
name="geoip.dat"
tmpfile=$tmpdir/geoip.dat
link="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
download_file
name="geosite.dat"
tmpfile=$tmpdir/geosite.dat
link="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat"
download_file
cp -f $tmpdir/*.dat $is_core_dir/bin/
;;
caddy)
name="Caddy"
tmpfile=$tmpdir/caddy.tar.gz