修复ui 添加gost静默http服务

This commit is contained in:
qaq
2025-06-20 11:26:31 +08:00
parent 52d9d18371
commit 17fc3de53e
+3 -3
View File
@@ -71,9 +71,9 @@ fi
GOST_CONFIG="$INSTALL_DIR/gost.json"
if [[ -f "$GOST_CONFIG" ]]; then
echo "📝 更新配置: gost.json"
sed -i.bak "s|\"addr\": \":.*\"|\"addr\": \":$PORT\"|g" "$GOST_CONFIG"
sed -i.bak "s|\"username\": \".*\"|\"username\": \"$SECRET\"|g" "$GOST_CONFIG"
sed -i.bak "s|\"password\": \".*\"|\"password\": \"$SECRET\"|g" "$GOST_CONFIG"
sed -i.bak '/\"name\": \"web_api\"/,/}/ { s|\"addr\": \":.*\"|\"addr\": \":'"$PORT"'\"|g; }' "$GOST_CONFIG"
sed -i.bak '/\"name\": \"web_api\"/,/}/ { s|\"username\": \".*\"|\"username\": \"'"$SECRET"'\"|g; }' "$GOST_CONFIG"
sed -i.bak '/\"name\": \"web_api\"/,/}/ { s|\"password\": \".*\"|\"password\": \"'"$SECRET"'\"|g; }' "$GOST_CONFIG"
rm -f "$GOST_CONFIG.bak"
else
echo "📄 创建新配置: gost.json"