tools: Simplify nonetwork handling
... and fix the indentation. Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
parent
174254bbb1
commit
7b51adc752
1 changed files with 2 additions and 6 deletions
|
@ -53,7 +53,7 @@ EOH
|
||||||
}
|
}
|
||||||
|
|
||||||
send_email() {
|
send_email() {
|
||||||
if [[ ${nonetwork} == 0 ]]; then
|
[[ ${nonetwork} == 0 ]] || return
|
||||||
|
|
||||||
local subject="${EMAIL_SUBJECT_PREPEND} $1"
|
local subject="${EMAIL_SUBJECT_PREPEND} $1"
|
||||||
local message=$2
|
local message=$2
|
||||||
|
@ -69,8 +69,6 @@ send_email() {
|
||||||
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
|
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
|
||||||
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
|
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
|
||||||
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
|
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: run_cmd <logfile> <command to run>
|
# Usage: run_cmd <logfile> <command to run>
|
||||||
|
@ -249,7 +247,7 @@ git_update() {
|
||||||
# SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
|
# SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
|
||||||
# working.
|
# working.
|
||||||
verify_dnssec() {
|
verify_dnssec() {
|
||||||
if [[ ${nonetwork} == 0 ]]; then
|
[[ ${nonetwork} == 0 ]] || return
|
||||||
|
|
||||||
which dig >/dev/null || {
|
which dig >/dev/null || {
|
||||||
echo "net-dns/bind-tools is needed to verify DNSSEC is working"
|
echo "net-dns/bind-tools is needed to verify DNSSEC is working"
|
||||||
|
@ -265,8 +263,6 @@ verify_dnssec() {
|
||||||
echo "DNSSEC is not enabled in /etc/resolv.conf"
|
echo "DNSSEC is not enabled in /etc/resolv.conf"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
upload() {
|
upload() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue