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