From da81d2436c2df31d06983ea63888789bd3447d31 Mon Sep 17 00:00:00 2001 From: guochao Date: Mon, 18 Jul 2022 16:04:10 +0800 Subject: [PATCH] fix updater --- pkgs/network/proxy/clash-premium/updater.nix | 8 ++++---- pkgs/network/proxy/clash-premium/updater.sh | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/network/proxy/clash-premium/updater.nix b/pkgs/network/proxy/clash-premium/updater.nix index 75ca1dd..a77b679 100644 --- a/pkgs/network/proxy/clash-premium/updater.nix +++ b/pkgs/network/proxy/clash-premium/updater.nix @@ -10,11 +10,11 @@ dontPatchELF = true; dontUnpack = true; - checkPhase = '' - patchShebangs bin - ''; installPhase = '' - makeWrapper $src $out/bin/clash-updater --set SUBSCRIPTION_URL "${subscription}" + mkdir -pv $out/bin + cp -v $src $out/bin/updater.sh + patchShebangs $out/bin/updater.sh + makeWrapper $out/bin/updater.sh $out/bin/clash-updater --set SUBSCRIPTION_URL "${subscription}" ''; } diff --git a/pkgs/network/proxy/clash-premium/updater.sh b/pkgs/network/proxy/clash-premium/updater.sh index 4598d4e..b3d25d7 100755 --- a/pkgs/network/proxy/clash-premium/updater.sh +++ b/pkgs/network/proxy/clash-premium/updater.sh @@ -3,18 +3,17 @@ set -euo pipefail IFS=$'\n\t' -TEMP=${TEMP:-$(mktemp /tmp/clash-config-XXXXXX)} -OUTPUT=${OUTPUT:-$HOME/.config/clash/testoutput.yaml} +TEMP=$(mktemp /tmp/clash-config-XXXXXX) +OUTPUT=${OUTPUT:-$HOME/.config/clash/config.yaml} OUTDIR=$(dirname $OUTPUT) LOG="/tmp/clash-updater.log" - -exec > ${LOG} +exec 2>&1 > ${LOG} set -x while true; do - curl -v --continue -o ${TEMP} ${SUBSCRIPTION_URL} + curl -v -o ${TEMP} ${SUBSCRIPTION_URL} RET=$? if [[ $RET -eq 0 ]]; then