Skip to content

Commit c8ea1ce

Browse files
committed
优化 Windows 运行脚本
1 parent 7d3e644 commit c8ea1ce

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

_posts/2024-08-22-share-windows-singboxr-ruleset.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Windows Registry Editor Version 5.00
435435
echo
436436
echo "正在启动 sing-boxr 服务..."
437437
cd ./sing-box
438-
start //min sing-box.exe run
438+
start //min sing-box run
439439
read -n1 -r -p "启动 sing-boxr 服务成功,按任意键返回菜单..."
440440
break
441441
;;
@@ -509,7 +509,7 @@ Windows Registry Editor Version 5.00
509509
echo
510510
echo "正在启动 sing-boxr 服务..."
511511
cd ./sing-box
512-
start //min sing-box.exe run
512+
start //min sing-box run
513513
read -n1 -r -p "启动 sing-boxr 服务成功,按任意键返回菜单..."
514514
break
515515
;;
@@ -588,7 +588,7 @@ Windows Registry Editor Version 5.00
588588
cd "$PROGRAMFILES"
589589
if [[ -f "./sing-box/sing-box.exe" && -f "./sing-box/config.json" ]]; then
590590
cd "./sing-box"
591-
start //min sing-box.exe run
591+
start //min sing-box run
592592
read -n1 -r -p "启动 sing-boxr 服务成功,按任意键返回菜单..."
593593
else
594594
read -n1 -r -p "未检测到 sing-boxr 内核和配置文件,请返回菜单安装内核并导入配置文件!按任意键返回菜单..."
@@ -619,7 +619,7 @@ Windows Registry Editor Version 5.00
619619

620620
```shell
621621
cd "%PROGRAMFILES%\sing-box"
622-
start /min sing-box.exe run
622+
start /min sing-box run
623623
```
624624

625625
- ② 另存为 run.bat 文件并复制到 `%PROGRAMFILES%\sing-box`{: .filepath} 文件夹中

_posts/2024-12-04-share-windows-mihomo-ruleset.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Windows Registry Editor Version 5.00
393393
- ① 编辑本文文档,粘贴如下内容:
394394
注:
395395
- ➊ 将《[一](https://proxy-tutorials.dustinwin.us.kg/posts/share-windows-mihomo-ruleset/#%E4%B8%80-%E7%94%9F%E6%88%90%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6-yaml-%E6%96%87%E4%BB%B6%E7%9B%B4%E9%93%BE)》中生成的配置文件 .yaml 文件直链替换下面命令中的 `{.yaml 配置文件直链}`
396-
- ➋ 或者删除此条命令,直接进入 `%PROGRAMFILES%\mihomo\profiles`{: .filepath} 文件夹,新建 config.yaml 文件并粘贴配置内容
396+
- ➋ 或者删除此条命令,直接进入 `%PROGRAMFILES%\mihomo`{: .filepath} 文件夹,新建 config.yaml 文件并粘贴配置内容
397397

398398
```shell
399399
#!/bin/bash
@@ -434,7 +434,7 @@ Windows Registry Editor Version 5.00
434434
435435
echo "正在更新 mihomo 内核..."
436436
mv -f "$USERPROFILE/Downloads/mihomo.exe" ./mihomo
437-
if [ -f "./mihomo/profiles/config.yaml" ]; then
437+
if [ -f "./mihomo/config.yaml" ]; then
438438
echo "更新 mihomo 内核成功,是否启动服务?(Y/n)"
439439
while true; do
440440
read -n1 -r choice
@@ -443,7 +443,7 @@ Windows Registry Editor Version 5.00
443443
echo
444444
echo "正在启动 mihomo 服务..."
445445
cd ./mihomo
446-
start //min mihomo.exe run
446+
start //min mihomo -d .
447447
read -n1 -r -p "启动 mihomo 服务成功,按任意键返回菜单..."
448448
break
449449
;;
@@ -515,7 +515,7 @@ Windows Registry Editor Version 5.00
515515
echo
516516
echo "正在启动 mihomo 服务..."
517517
cd ./mihomo
518-
start //min mihomo.exe run
518+
start //min mihomo -d .
519519
read -n1 -r -p "启动 mihomo 服务成功,按任意键返回菜单..."
520520
break
521521
;;
@@ -532,7 +532,7 @@ Windows Registry Editor Version 5.00
532532
533533
echo "导入(更新)mihomo 配置文件"
534534
cd "$PROGRAMFILES"
535-
if [[ -f "./mihomo/mihomo.exe" && -f "./mihomo/profiles/config.yaml" ]]; then
535+
if [[ -f "./mihomo/mihomo.exe" && -f "./mihomo/config.yaml" ]]; then
536536
echo "检测到 mihomo 配置文件,是否更新?(Y/n)"
537537
while true; do
538538
read -n1 -r choice
@@ -548,7 +548,7 @@ Windows Registry Editor Version 5.00
548548
echo "结束 mihomo 相关进程成功"
549549
550550
echo "正在更新 mihomo 配置文件..."
551-
mv -f "$USERPROFILE/Downloads/config.yaml" ./mihomo/profiles
551+
mv -f "$USERPROFILE/Downloads/config.yaml" ./mihomo
552552
echo "更新 mihomo 配置文件成功,是否启动服务?(Y/n)"
553553
ask_run
554554
break
@@ -562,11 +562,11 @@ Windows Registry Editor Version 5.00
562562
;;
563563
esac
564564
done
565-
elif [ ! -f "./mihomo/profiles/config.yaml" ]; then
565+
elif [ ! -f "./mihomo/config.yaml" ]; then
566566
echo "未检测到 mihomo 配置文件,导入配置文件..."
567-
mkdir -p ./mihomo/profiles
567+
mkdir -p ./mihomo
568568
curl -sS -o "$USERPROFILE/Downloads/config.yaml" -L https://ghfast.top/{.yaml 配置文件直链}
569-
mv -f "$USERPROFILE/Downloads/config.yaml" ./mihomo/profiles
569+
mv -f "$USERPROFILE/Downloads/config.yaml" ./mihomo
570570
echo "导入 mihomo 配置文件成功,是否启动服务?(Y/n)"
571571
ask_run
572572
else
@@ -576,9 +576,9 @@ Windows Registry Editor Version 5.00
576576
3)
577577
echo "正在启动 mihomo 服务..."
578578
cd "$PROGRAMFILES"
579-
if [[ -f "./mihomo/mihomo.exe" && -f "./mihomo/profiles/config.yaml" ]]; then
579+
if [[ -f "./mihomo/mihomo.exe" && -f "./mihomo/config.yaml" ]]; then
580580
cd "./mihomo"
581-
start //min mihomo.exe -d profiles
581+
start //min mihomo -d .
582582
read -n1 -r -p "启动 mihomo 服务成功,按任意键返回菜单..."
583583
else
584584
read -n1 -r -p "未检测到 mihomo 内核和配置文件,请返回菜单安装内核并导入配置文件!按任意键返回菜单..."
@@ -609,7 +609,7 @@ Windows Registry Editor Version 5.00
609609

610610
```shell
611611
cd "%PROGRAMFILES%\mihomo"
612-
start /min mihomo.exe -d profiles
612+
start /min mihomo -d .
613613
```
614614

615615
- ② 另存为 run.bat 文件并复制到 `%PROGRAMFILES%\mihomo`{: .filepath} 文件夹中

0 commit comments

Comments
 (0)