1 |
commit: 7b51adc7521e137a33c5a5924b03054dc736585f |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 31 23:24:53 2021 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 31 23:27:13 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=7b51adc7 |
7 |
|
8 |
tools: Simplify nonetwork handling |
9 |
|
10 |
... and fix the indentation. |
11 |
|
12 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
13 |
|
14 |
tools/catalyst-auto | 8 ++------ |
15 |
1 file changed, 2 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/tools/catalyst-auto b/tools/catalyst-auto |
18 |
index 70be8055..1f053048 100755 |
19 |
--- a/tools/catalyst-auto |
20 |
+++ b/tools/catalyst-auto |
21 |
@@ -53,7 +53,7 @@ EOH |
22 |
} |
23 |
|
24 |
send_email() { |
25 |
- if [[ ${nonetwork} == 0 ]]; then |
26 |
+ [[ ${nonetwork} == 0 ]] || return |
27 |
|
28 |
local subject="${EMAIL_SUBJECT_PREPEND} $1" |
29 |
local message=$2 |
30 |
@@ -69,8 +69,6 @@ send_email() { |
31 |
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \ |
32 |
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \ |
33 |
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ } |
34 |
- |
35 |
- fi |
36 |
} |
37 |
|
38 |
# Usage: run_cmd <logfile> <command to run> |
39 |
@@ -249,7 +247,7 @@ git_update() { |
40 |
# SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is |
41 |
# working. |
42 |
verify_dnssec() { |
43 |
- if [[ ${nonetwork} == 0 ]]; then |
44 |
+ [[ ${nonetwork} == 0 ]] || return |
45 |
|
46 |
which dig >/dev/null || { |
47 |
echo "net-dns/bind-tools is needed to verify DNSSEC is working" |
48 |
@@ -265,8 +263,6 @@ verify_dnssec() { |
49 |
echo "DNSSEC is not enabled in /etc/resolv.conf" |
50 |
exit 1 |
51 |
fi |
52 |
- |
53 |
- fi |
54 |
} |
55 |
|
56 |
upload() { |