Skip to content

Commit

Permalink
feat(proxy): 修复开机自启动功能
Browse files Browse the repository at this point in the history
  • Loading branch information
fishros committed Jul 8, 2024
1 parent c9e5137 commit b3b86f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/tool_install_proxy_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@
else
echo "文件已存在,无需下载。"
fi
./clash &
sleep 3
cd $HOME/.clash/public && python3 -m http.server --bind 0.0.0.0 8088 &
xdg-open http://127.0.0.1:8088/ >> /dev/null &
sleep 1
echo "==============================================="
echo "终端通过环境变量设置: export http_proxy=http://127.0.0.1:7890 && export https_proxy=http://127.0.0.1:7890"
echo "配置系统默认代理方式: 系统设置->网络->网络代理->手动->HTTP(127.0.0.1 7890)->HTTPS(127.0.0.1 7890)"
echo "管理页面方法:https://fishros.org.cn/forum/topic/668 "
echo "=============================================="
echo "===========该页面持续运行中,请误关闭!============"
echo "=============================================="
xdg-open http://127.0.0.1:8088/ >> /dev/null &
./clash
"""

start_clash_desktop ="""[Desktop Entry]
Expand Down Expand Up @@ -121,6 +119,7 @@ def install_proxy_tool(self):
auto_start_path = "{}.config/autostart/".format(user_home)
if code==2: FileUtils.delete(auto_start_path+"start_clash.desktop")
if code==1:
CmdTask('sudo apt install gnome-terminal -y',os_command=True).run()
FileUtils.new(path=auto_start_path,name="start_clash.desktop",data=start_clash_desktop.replace("{script_path}",clash_home+"start_clash.sh"))
CmdTask('sudo chmod a+x {}start_clash.desktop'.format(auto_start_path),os_command=True).run()

Expand Down

0 comments on commit b3b86f3

Please sign in to comment.