Remove temp file

This commit is contained in:
Kroese 2023-04-19 01:48:45 +02:00 committed by GitHub
parent 9b4d9659f5
commit 2a8f26e01e

View File

@ -27,16 +27,13 @@ start() {
echo 'ERROR: Agent script not found!' > /dev/ttyS0
TMP="/tmp/agent.sh"
URL="https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh"
rm -f "${TMP}"
if ! curl -sfk -m 10 -o "${TMP}" "${URL}"; then
if ! curl -sfk -m 10 -o "${SCRIPT}" "${URL}"; then
rm -f "${SCRIPT}"
return 1
fi
mv -f "${TMP}" "${SCRIPT}"
chmod 755 "${SCRIPT}"
fi