mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-11-26 00:18:24 -05:00
Move security-misc/apt-get-update* to helper-scripts
This commit is contained in:
parent
51d5ba29df
commit
c33ea7be6d
2 changed files with 0 additions and 67 deletions
|
|
@ -1,46 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
|
||||||
## See the file COPYING for copying conditions.
|
|
||||||
|
|
||||||
## TODO: Move this to helper-scripts.
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o errtrace
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
command -v start-stop-daemon >/dev/null
|
|
||||||
command -v timeout >/dev/null
|
|
||||||
command -v apt-get >/dev/null
|
|
||||||
|
|
||||||
export LC_ALL=C
|
|
||||||
pidfile="/run/helper-scripts/security-misc-apt-get-update-pid"
|
|
||||||
|
|
||||||
sigterm_trap() {
|
|
||||||
/usr/libexec/helper-scripts/apt-get-update-kill-helper &>/dev/null
|
|
||||||
exit 143
|
|
||||||
}
|
|
||||||
|
|
||||||
## terminate potential previous invocations.
|
|
||||||
/usr/libexec/helper-scripts/apt-get-update-kill-helper &>/dev/null
|
|
||||||
|
|
||||||
trap "sigterm_trap" SIGTERM SIGINT
|
|
||||||
|
|
||||||
[[ -v timeout_after ]] || timeout_after="600"
|
|
||||||
[[ -v kill_after ]] || kill_after="10"
|
|
||||||
|
|
||||||
start-stop-daemon \
|
|
||||||
--make-pidfile \
|
|
||||||
--pidfile "$pidfile" \
|
|
||||||
--exec /usr/bin/timeout \
|
|
||||||
--start \
|
|
||||||
-- \
|
|
||||||
--kill-after="$kill_after" \
|
|
||||||
"$timeout_after" \
|
|
||||||
apt-get update --error-on=any "$@" &
|
|
||||||
|
|
||||||
lastpid="$!"
|
|
||||||
wait "$lastpid"
|
|
||||||
|
|
||||||
exit "$?"
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
|
|
||||||
## See the file COPYING for copying conditions.
|
|
||||||
|
|
||||||
set -x
|
|
||||||
set -e
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
if ! printf '%s\n' "" | wc -l >/dev/null ; then
|
|
||||||
printf '%s\n' "\
|
|
||||||
$0: ERROR: command 'wc' test failed! Do not ignore this!
|
|
||||||
|
|
||||||
'wc' can core dump. Example:
|
|
||||||
zsh: illegal hardware instruction (core dumped) wc -l
|
|
||||||
https://github.com/rspamd/rspamd/issues/5137" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
wc -L "/var/lib/apt/lists/"*InRelease
|
|
||||||
wc -L "/var/lib/apt/lists/"*InRelease | awk '$1 > 1024 {print; exit 1}'
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue