Skip to content

Commit

Permalink
Do not nest quotes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Jul 1, 2022
1 parent 25aa2cf commit 5bcf54e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions padd.sh
Expand Up @@ -570,12 +570,12 @@ GetVersionInformation() {
fi

# PADD version information...
padd_version_latest="$(curl --silent https://api.github.com/repos/pi-hole/PADD/releases/latest | grep '"tag_name":' | awk -F \" '{print $4}')"
padd_version_latest=$(curl --silent https://api.github.com/repos/pi-hole/PADD/releases/latest | grep '"tag_name":' | awk -F \" '{print $4}')
# is PADD up-to-date?
if [ "${padd_version_latest}" = "" ]; then
padd_version_heatmap=${yellow_text}
else
if [ "$(VersionConverter "${padd_version}")" -lt "$(VersionConverter "${padd_version_latest}")" ]; then
if [ "$(VersionConverter ${padd_version})" -lt "$(VersionConverter "${padd_version_latest}")" ]; then
padd_out_of_date_flag="true"
padd_version_heatmap=${red_text}
else
Expand Down Expand Up @@ -1063,8 +1063,8 @@ CheckConnectivity() {

# converts a given version string e.g. v3.7.1 to 3007001000 to allow for easier comparison of multi digit version numbers
# credits https://apple.stackexchange.com/a/123408
VersionConverter() {
echo "$@" | tr -d '[:alpha:]' | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
VersionConverter() {
echo "$@" | tr -d '[:alpha:]' | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
}

########################################## MAIN FUNCTIONS ##########################################
Expand Down

0 comments on commit 5bcf54e

Please sign in to comment.