8
8
#
9
9
# ######################################################################################################################
10
10
#
11
- # Copyright (c) 2021-2023 framp at linux-tips-and-tricks dot de
11
+ # Copyright (c) 2021-2025 framp at linux-tips-and-tricks dot de
12
12
#
13
13
# This program is free software: you can redistribute it and/or modify
14
14
# it under the terms of the GNU General Public License as published by
25
25
#
26
26
# ######################################################################################################################
27
27
28
+ # shellcheck disable=SC2034,SC2154
29
+ # (warning): Date is referenced but not assigned (did you mean 'DATE'?).
30
+ # (warning): GIT_DATE appears unused. Verify use (or export if used externally).
28
31
GIT_DATE=" $Date $"
29
- GIT_DATE_ONLY= ${GIT_DATE /: / }
30
- GIT_DATE_ONLY= $( cut -f 2 -d ' ' <<< $GIT_DATE )
31
- GIT_TIME_ONLY= $( cut -f 3 -d ' ' <<< $GIT_DATE )
32
+ # shellcheck disable=SC2034,SC2154
33
+ # (warning): Sha1 is referenced but not assigned (did you mean 'DATE'?).
34
+ # (warning): GIT_COMMIT appears unused. Verify use (or export if used externally).
32
35
GIT_COMMIT=" $Sha1 $"
33
- GIT_COMMIT_ONLY=$( cut -f 2 -d ' ' <<< $GIT_COMMIT | sed ' s/\$//' )
34
36
35
37
MYHOMEDOMAIN=" www.linux-tips-and-tricks.de"
36
38
MYHOMEURL=" https://$MYHOMEDOMAIN "
@@ -53,17 +55,19 @@ DATE="$(base64 -d <<< "$DATE")"
53
55
54
56
function analyze() { # fileName url
55
57
tmp=$( mktemp)
56
- wget $2 -q --tries=$DOWNLOAD_RETRIES --timeout=$DOWNLOAD_TIMEOUT -O $tmp
58
+ wget " $2 " -q --tries=" $DOWNLOAD_RETRIES " --timeout=" $DOWNLOAD_TIMEOUT " -O " $tmp "
57
59
58
60
# GIT_COMMIT="$Sha1$"
59
61
sha=" $( grep " ^GIT_COMMIT=" " $tmp " | cut -f 2 -d ' ' | sed -e " s/[\$\" \']//g" ) "
60
62
if [[ -z " $sha " ]]; then
61
63
sha=" $( grep " GIT_COMMIT=" " $tmp " | cut -f 3-4 -d ' ' ) "
62
64
fi
63
65
if [[ -z " $sha " ]]; then
64
- sha=" $( grep " $SHA " $tmp | cut -f 3-4 -d ' ' ) "
66
+ sha=" $( grep " $SHA " " $tmp " | cut -f 3-4 -d ' ' ) "
65
67
fi
66
68
69
+ # shellcheck disable=SC2001
70
+ # (style): See if you can use ${variable//search/replace} instead.
67
71
sha=" $( sed -e " s/[\$\" ]//g" <<< " $sha" ) "
68
72
69
73
# VERSION="0.6.5-beta" # -beta, -hotfix or -dev suffixes possible
@@ -78,7 +82,7 @@ function analyze() { # fileName url
78
82
date=" $( grep " GIT_DATE=" " $tmp " | cut -f 3-4 -d ' ' ) "
79
83
fi
80
84
if [[ -z " $date " ]]; then
81
- date=" $( grep " $DATE " $tmp | cut -f 3-4 -d ' ' ) "
85
+ date=" $( grep " $DATE " " $tmp " | cut -f 3-4 -d ' ' ) "
82
86
fi
83
87
84
88
[[ -z " $version " ]] && version=" N/A"
@@ -87,7 +91,7 @@ function analyze() { # fileName url
87
91
88
92
89
93
printf " %-30s: Version: %-10s Date: %-20s Sha: %-10s\n" " $1 " " $version " " $date " " $sha "
90
- rm $tmp
94
+ rm " $tmp "
91
95
}
92
96
93
97
analyze " raspiBackup" $DOWNLOAD_URL
0 commit comments