From d708b78ebe17037e7abd05997812aba1495a2bee Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 17 Jun 2024 22:08:58 +0000 Subject: [PATCH] scripts/check-uninsane: fix ftp check, to not error if README.md exists in the current directory --- scripts/check-uninsane | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/check-uninsane b/scripts/check-uninsane index d3a8ad9e..4bda812c 100755 --- a/scripts/check-uninsane +++ b/scripts/check-uninsane @@ -55,7 +55,17 @@ check "servo-hn wireguard network" ping -c 1 -W 3 servo-hn check "git.uninsane.org" git ls-remote origin --quiet -check "ftp://uninsane.org" lftpget ftp://uninsane.org/README.md && rm README.md +lftpgetIntoTmp() { + local url="$1" + local localName="$2" + ( + # run these commands in a subshell to preserve the old PWD + pushd /tmp + rm -f "$localName" + lftpget "$url" + ) +} +check "ftp://uninsane.org" lftpgetIntoTmp ftp://uninsane.org/README.md README.md echo "" echo "systemctl --failed:"