mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Find 404 errors and relay message.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
48351fed79
commit
5e6f8489a9
1 changed files with 5 additions and 3 deletions
|
@ -1161,22 +1161,24 @@ FTLinstall() {
|
||||||
|
|
||||||
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
|
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
|
||||||
if [ ! "${latesttag}" ]; then
|
if [ ! "${latesttag}" ]; then
|
||||||
echo "::: failed (error in getting latest release location from GitHub)"
|
echo "failed (error in getting latest release location from GitHub)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if curl -sSL --fail "https://github.com/pi-hole/FTL/releases/download/${latesttag%$'\r'}/${binary}" -o "/tmp/pihole-FTL"; then
|
if curl -sSL --fail "https://github.com/pi-hole/FTL/releases/download/${latesttag%$'\r'}/${binary}" -o "/tmp/pihole-FTL"; then
|
||||||
# Check if we just downloaded text, or a binary file.
|
# Check if we just downloaded text, or a binary file.
|
||||||
if ! grep -qI '.' /tmp/pihole-FTL; then
|
if ! grep -qI '.' /tmp/pihole-FTL; then
|
||||||
echo "::: done"
|
echo "done"
|
||||||
install -m 0755 /tmp/pihole-FTL /usr/bin
|
install -m 0755 /tmp/pihole-FTL /usr/bin
|
||||||
touch /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
touch /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
||||||
chmod 0666 /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
chmod 0666 /var/log/pihole-FTL.log /var/run/pihole-FTL.pid /var/run/pihole-FTL.port
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo "::: failed (download of binary from Github failed)"
|
echo "failed (download of binary from Github failed)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo "done"
|
echo "done"
|
||||||
|
else
|
||||||
|
echo "failed (URL not found.)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue