use strict shell options

This commit is contained in:
Patrick Schleizer 2024-11-25 15:48:01 -05:00
parent d32cb8c95b
commit f9b5d7d3f4
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -3,6 +3,11 @@
## Copyright (C) 2012 - 2024 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
set -o errexit
set -o nounset
set -o errtrace
set -o pipefail
write_pid_file() {
[[ -z "${TMP:-}" ]] && error "TMP is unset"
safe-rm -rf "$TMP/security-misc-apt-get-update-pid";
@ -25,8 +30,8 @@ sigterm_trap() {
trap "sigterm_trap" SIGTERM SIGINT
[ -n "$timeout_after" ] || timeout_after="600"
[ -n "$kill_after" ] || kill_after="10"
[[ -v timeout_after ]] || timeout_after="600"
[[ -v kill_after ]] || kill_after="10"
write_pid_file