mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Replace which
with command -v
(#4499)
Signed-off-by: WaLLy3K WaLLy3K@users.noreply.github.com
This commit is contained in:
parent
886f0c7df3
commit
5bd7cc9c9d
1 changed files with 3 additions and 3 deletions
|
@ -2277,7 +2277,7 @@ FTLcheckUpdate() {
|
||||||
printf " %b Checking for existing FTL binary...\\n" "${INFO}"
|
printf " %b Checking for existing FTL binary...\\n" "${INFO}"
|
||||||
|
|
||||||
local ftlLoc
|
local ftlLoc
|
||||||
ftlLoc=$(which pihole-FTL 2>/dev/null)
|
ftlLoc=$(command -v pihole-FTL 2>/dev/null)
|
||||||
|
|
||||||
local ftlBranch
|
local ftlBranch
|
||||||
|
|
||||||
|
@ -2315,7 +2315,7 @@ FTLcheckUpdate() {
|
||||||
# We already have a pihole-FTL binary downloaded.
|
# We already have a pihole-FTL binary downloaded.
|
||||||
# Alt branches don't have a tagged version against them, so just confirm the checksum of the local vs remote to decide whether we download or not
|
# Alt branches don't have a tagged version against them, so just confirm the checksum of the local vs remote to decide whether we download or not
|
||||||
remoteSha1=$(curl -sSL --fail "https://ftl.pi-hole.net/${ftlBranch}/${binary}.sha1" | cut -d ' ' -f 1)
|
remoteSha1=$(curl -sSL --fail "https://ftl.pi-hole.net/${ftlBranch}/${binary}.sha1" | cut -d ' ' -f 1)
|
||||||
localSha1=$(sha1sum "$(which pihole-FTL)" | cut -d ' ' -f 1)
|
localSha1=$(sha1sum "$(command -v pihole-FTL)" | cut -d ' ' -f 1)
|
||||||
|
|
||||||
if [[ "${remoteSha1}" != "${localSha1}" ]]; then
|
if [[ "${remoteSha1}" != "${localSha1}" ]]; then
|
||||||
printf " %b Checksums do not match, downloading from ftl.pi-hole.net.\\n" "${INFO}"
|
printf " %b Checksums do not match, downloading from ftl.pi-hole.net.\\n" "${INFO}"
|
||||||
|
@ -2345,7 +2345,7 @@ FTLcheckUpdate() {
|
||||||
printf " %b Latest FTL Binary already installed (%s). Confirming Checksum...\\n" "${INFO}" "${FTLlatesttag}"
|
printf " %b Latest FTL Binary already installed (%s). Confirming Checksum...\\n" "${INFO}" "${FTLlatesttag}"
|
||||||
|
|
||||||
remoteSha1=$(curl -sSL --fail "https://github.com/pi-hole/FTL/releases/download/${FTLversion%$'\r'}/${binary}.sha1" | cut -d ' ' -f 1)
|
remoteSha1=$(curl -sSL --fail "https://github.com/pi-hole/FTL/releases/download/${FTLversion%$'\r'}/${binary}.sha1" | cut -d ' ' -f 1)
|
||||||
localSha1=$(sha1sum "$(which pihole-FTL)" | cut -d ' ' -f 1)
|
localSha1=$(sha1sum "$(command -v pihole-FTL)" | cut -d ' ' -f 1)
|
||||||
|
|
||||||
if [[ "${remoteSha1}" != "${localSha1}" ]]; then
|
if [[ "${remoteSha1}" != "${localSha1}" ]]; then
|
||||||
printf " %b Corruption detected...\\n" "${INFO}"
|
printf " %b Corruption detected...\\n" "${INFO}"
|
||||||
|
|
Loading…
Reference in a new issue