mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-03-21 22:06:45 +08:00
Update generate_config.sh
This commit is contained in:
@ -131,17 +131,22 @@ apply_secret_to_config() {
|
|||||||
|
|
||||||
apply_controller_to_config() {
|
apply_controller_to_config() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
local ui_dir="$PROJECT_DIR/ui/dist"
|
local ui_src="$PROJECT_DIR/ui/dist"
|
||||||
|
local ui_dir="$RUNTIME_DIR/ui"
|
||||||
|
|
||||||
if [ "$EXTERNAL_CONTROLLER_ENABLED" = "true" ]; then
|
if [ "$EXTERNAL_CONTROLLER_ENABLED" = "true" ]; then
|
||||||
upsert_yaml_kv_local "$file" "external-controller" "$EXTERNAL_CONTROLLER"
|
upsert_yaml_kv_local "$file" "external-controller" "$EXTERNAL_CONTROLLER"
|
||||||
|
|
||||||
if [ -f "$ui_dir/index.html" ]; then
|
if [ ! -f "$ui_src/index.html" ]; then
|
||||||
upsert_yaml_kv_local "$file" "external-ui" "$ui_dir"
|
echo "[ERROR] UI not found: $ui_src/index.html" >&2
|
||||||
else
|
|
||||||
echo "[ERROR] UI not found: $ui_dir/index.html" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$ui_dir"
|
||||||
|
mkdir -p "$ui_dir"
|
||||||
|
cp -a "$ui_src/." "$ui_dir/"
|
||||||
|
|
||||||
|
upsert_yaml_kv_local "$file" "external-ui" "$ui_dir"
|
||||||
else
|
else
|
||||||
remove_yaml_key_local "$file" "external-controller"
|
remove_yaml_key_local "$file" "external-controller"
|
||||||
remove_yaml_key_local "$file" "external-ui"
|
remove_yaml_key_local "$file" "external-ui"
|
||||||
|
|||||||
Reference in New Issue
Block a user