v1.0.0beta13fix2

~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
This commit is contained in:
juewuy
2020-10-07 16:31:39 +08:00
parent 8827f2d561
commit 420aeeba3d
4 changed files with 22 additions and 9 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
GeoIP_v=20201001 GeoIP_v=20201001
clash_v=1.1.0 clash_v=1.1.0
clashpre_v=2020.09.27 clashpre_v=2020.09.27
versionsh=1.0.0beta13fix1 versionsh=1.0.0beta13fix2

View File

@@ -686,21 +686,18 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
if [ "$local_proxy" = "未开启" ] > /dev/null 2>&1; then if [ "$local_proxy" = "未开启" ] > /dev/null 2>&1; then
sed -i "1i\local_proxy=已开启" $ccfg sed -i "1i\local_proxy=已开启" $ccfg
local_proxy=已开启 local_proxy=已开启
echo 'export http_proxy=http://127.0.0.1:'"$mix_port" >> /etc/profile source $clashdir/start.sh
echo 'export https_proxy=$http_proxy' >> /etc/profile set_proxy
echo 'export HTTP_PROXY=$http_proxy' >> /etc/profile
echo 'export HTTPS_PROXY=$http_proxy' >> /etc/profile
echo -e "\033[32m已经将代理参数写入环境变量~\033[0m" echo -e "\033[32m已经将代理参数写入环境变量~\033[0m"
echo -e "\033[36m如未生效请重新登录或者重启设备\033[0m" echo -e "\033[36m如未生效请重新登录或者重启设备\033[0m"
sleep 1 sleep 1
else else
sed -i "1i\local_proxy=未开启" $ccfg sed -i "1i\local_proxy=未开启" $ccfg
sed -i '/http*_proxy/'d /etc/profile
sed -i '/HTTP*_PROXY/'d /etc/profile
echo -e "\033[33m已经将代理参数从环境变量移除\033[0m"
local_proxy=未开启 local_proxy=未开启
source $clashdir/start.sh
unset_proxy
echo -e "\033[33m已经将代理参数从环境变量移除\033[0m"
fi fi
source /etc/profile > /dev/null 2>&1
clashadv clashadv
elif [[ $num == 5 ]]; then elif [[ $num == 5 ]]; then
setport setport

View File

@@ -282,6 +282,18 @@ daemon(){
echo 请进入定时任务菜单手动指定系统定时任务文件路径!!! echo 请进入定时任务菜单手动指定系统定时任务文件路径!!!
fi fi
} }
set_proxy(){
echo 'export http_proxy=http://127.0.0.1:'"$mix_port" >> /etc/profile
echo 'export https_proxy=$http_proxy' >> /etc/profile
echo 'export HTTP_PROXY=$http_proxy' >> /etc/profile
echo 'export HTTPS_PROXY=$http_proxy' >> /etc/profile
source /etc/profile > /dev/null 2>&1
}
unset_proxy(){
sed -i '/http*_proxy/'d /etc/profile
sed -i '/HTTP*_PROXY/'d /etc/profile
source /etc/profile > /dev/null 2>&1
}
afstart(){ afstart(){
#读取配置文件 #读取配置文件
getconfig getconfig
@@ -291,6 +303,8 @@ afstart(){
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir [ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
#标记启动时间 #标记启动时间
mark_time mark_time
#设置本机代理
[ "$local_proxy" = "已开启" ] && set_proxy
} }
case "$1" in case "$1" in
@@ -328,6 +342,8 @@ stop)
killall -9 clash >/dev/null 2>&1 killall -9 clash >/dev/null 2>&1
#清理iptables #清理iptables
stop_iptables stop_iptables
#禁用本机代理
[ "$local_proxy" = "已开启" ] && unset_proxy
;; ;;
restart) restart)
$0 stop $0 stop