|
|
@ -1155,18 +1155,18 @@ if [[ "${reconfigure}" == true ]]; then
|
|
|
|
FTLinstall() {
|
|
|
|
FTLinstall() {
|
|
|
|
# Download and Install FTL binary
|
|
|
|
# Download and Install FTL binary
|
|
|
|
local binary="${1}"
|
|
|
|
local binary="${1}"
|
|
|
|
local latesttag
|
|
|
|
local latestURL
|
|
|
|
echo ":::"
|
|
|
|
echo ":::"
|
|
|
|
echo -n "::: Installing FTL ... "
|
|
|
|
echo -n "::: Installing FTL ... "
|
|
|
|
|
|
|
|
|
|
|
|
latesttag=$(curl -s https://api.github.com/repos/pi-hole/FTL/releases/latest | grep "tag_name" | sed "s/.*: \"//;s/\",//;")
|
|
|
|
latestURL=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk '{print $2}')
|
|
|
|
if [ ! "${latesttag}" ]; then
|
|
|
|
if [ ! "${latestURL}" ]; then
|
|
|
|
echo "::: failed (error in getting latest release tag 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}/${binary}" -o "/opt/pihole/pihole-FTL"; then
|
|
|
|
if curl -sSL --fail "${latestURL}${binary}" -o "/tmp/pihole-FTL"; then
|
|
|
|
echo "::: done"
|
|
|
|
echo "::: done"
|
|
|
|
install -m 0755 /opt/pihole/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
|
|
|
|