Skip to content

Commit

Permalink
v1.0.0beta13fix2
Browse files Browse the repository at this point in the history
~修复了导入未经转换配置文件时报错的bug
~屏蔽了部分已经无法使用的sub后端服务器地址
~修改了本机代理实现方式,现在会随着clash服务停止而取消
  • Loading branch information
juewuy committed Oct 7, 2020
1 parent 8827f2d commit 420aeeb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Binary file modified bin/clashfm.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GeoIP_v=20201001
clash_v=1.1.0
clashpre_v=2020.09.27
versionsh=1.0.0beta13fix1
versionsh=1.0.0beta13fix2
13 changes: 5 additions & 8 deletions scripts/clash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -686,21 +686,18 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
if [ "$local_proxy" = "未开启" ] > /dev/null 2>&1; then
sed -i "1i\local_proxy=已开启" $ccfg
local_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 $clashdir/start.sh
set_proxy
echo -e "\033[32m已经将代理参数写入环境变量~\033[0m"
echo -e "\033[36m如未生效,请重新登录或者重启设备!\033[0m"
sleep 1
else
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=未开启
source $clashdir/start.sh
unset_proxy
echo -e "\033[33m已经将代理参数从环境变量移除!!\033[0m"
fi
source /etc/profile > /dev/null 2>&1
clashadv
elif [[ $num == 5 ]]; then
setport
Expand Down
16 changes: 16 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ daemon(){
echo 请进入定时任务菜单手动指定系统定时任务文件路径!!!
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(){
#读取配置文件
getconfig
Expand All @@ -291,6 +303,8 @@ afstart(){
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
#标记启动时间
mark_time
#设置本机代理
[ "$local_proxy" = "已开启" ] && set_proxy
}
case "$1" in
Expand Down Expand Up @@ -328,6 +342,8 @@ stop)
killall -9 clash >/dev/null 2>&1
#清理iptables
stop_iptables
#禁用本机代理
[ "$local_proxy" = "已开启" ] && unset_proxy
;;
restart)
$0 stop
Expand Down

0 comments on commit 420aeeb

Please sign in to comment.