~新增保守方式启动,适配更多设备(小米3HD,以及其他linux系统)
~新增进阶功能菜单
~修复了geoip数据库偶尔丢失的bug(感谢Pan Peter同学提交bug!)
~增加了另一种本地面板的安装方式
~UI优化
This commit is contained in:
juewuy 2020-08-22 22:01:58 +08:00
parent e8876a17de
commit 08243de4e4
4 changed files with 33 additions and 20 deletions

Binary file not shown.

View File

@ -1,2 +1,2 @@
GeoIP_v=20200817
versionsh=0.9.8
versionsh=0.9.9

View File

@ -425,12 +425,27 @@ echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[36m安装本地版dashboard管理面板\033[0m"
echo -----------------------------------------------
echo -e "\033[32m打开管理面板的速度更快且更稳定"
echo -e "\033[33m需要占用约500kb的本地空间(目录:/www/clash)\033[0m"
echo -e "\033[36m可以使用\033[32;4mhttp://$host/clash\033[0;36m访问面板\033[0m"
echo -e "\033[33m需要占用约500kb的本地空间\033[0m"
echo -----------------------------------------------
read -p "是否安装本地面板?[1/0] > " res
if [ "$res" = '1' ]; then
if [ -d /www/clash ];then
echo " 1 在/www/clash目录安装(http://$host/clash可能安装失败)"
echo " 2 在$clashdir/ui目录安装(http://$host:9999/ui推荐)"
echo -----------------------------------------------
echo " 0 返回上级菜单!"
read -p "请输入对应数字 > " num
if [ -z "$num" ];then
update
elif [ "$num" = '1' ]; then
dbdir=/www/clash
hostdir=':9999/ui'
elif [ "$num" = '2' ]; then
dbdir=$clashdir/ui
hostdir='/clash'
else
update
fi
#下载及安装
if [ -d /www/clash -o -d $clashdir/ui ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[31m检测到您已经安装过本地面板了\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -439,6 +454,7 @@ if [ "$res" = '1' ]; then
update
elif [ "$res" = 1 ]; then
rm -rf /www/clash
rm -rf $clashdir/ui
else
update
fi
@ -454,25 +470,20 @@ if [ "$res" = '1' ]; then
getdb
else
echo -e "\033[33m下载成功正在解压文件\033[0m"
if cat /proc/mounts | grep -q www ;then
echo 检测到/www为只读正在重新挂载
mount -o remount -w /www
fi
chmod 755 /www
mkdir -p /www/clash > /dev/null
tar -zxvf '/tmp/clashdb.tar.gz' -C /www/clash > /dev/null
mkdir -p $dbdir > /dev/null
tar -zxvf '/tmp/clashdb.tar.gz' -C $dbdir > /dev/null
[ $? -ne 0 ] && echo "文件解压失败!" && exit 1
#修改默认host和端口
sed -i "s/127.0.0.1/$host/g" /www/clash/js/*.js
sed -i "s/9090/9999/g" /www/clash/js/*.js
sed -i "s/127.0.0.1/$host/g" $dbdir/js/*.js
sed -i "s/9090/9999/g" $dbdir/js/*.js
#
echo -e "\033[32m面板安装成功\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[36m请使用\033[32;4mhttp://$host/clash\033[0;36m访问面板\033[0m"
echo -e "\033[36m请使用\033[32;4mhttp://$host$hostdir\033[0;36m访问面板\033[0m"
rm -rf /tmp/clashdb.tar.gz
update
fi
fi
update
}
setserver(){

View File

@ -33,6 +33,7 @@ else
ipv6='ipv6: false'
fi
external='external-controller: 0.0.0.0:9999'
external_ui='external-ui: ui'
if [ "$dns_mod" = "fake-ip" ];then
dns='dns: {enable: true, listen: 0.0.0.0:1053, fake-ip-range: 198.18.0.1/16, enhanced-mode: fake-ip, nameserver: [114.114.114.114, 127.0.0.1:53], fallback: [tcp://1.0.0.1, 8.8.4.4]}'
elif [ "$dns_over" = "已开启" ];then
@ -59,9 +60,10 @@ exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
sed -i "4a$log" $clashdir/config.yaml
sed -i "5a$ipv6" $clashdir/config.yaml
sed -i "6a$external" $clashdir/config.yaml
sed -i "7a$dns" $clashdir/config.yaml
sed -i "8a$tun" $clashdir/config.yaml
sed -i "9a$exper" $clashdir/config.yaml
sed -i "7a$external_ui" $clashdir/config.yaml
sed -i "8a$dns" $clashdir/config.yaml
sed -i "9a$tun" $clashdir/config.yaml
sed -i "10a$exper" $clashdir/config.yaml
#跳过本地tls证书验证
if [ "$skip_cert" != "未开启" ];then
sed -i "10,99s/sni: \S*/\1skip-cert-verify: true}/" $clashdir/config.yaml #跳过trojan本地证书验证