security-misc/usr/lib/security-misc/apt-get-update
Patrick Schleizer 203d5cfa68
copyright
2019-10-31 11:19:44 -04:00

33 lines
594 B
Bash
Executable File

#!/bin/bash
## Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
## See the file COPYING for copying conditions.
sigterm_trap() {
if [ "$lastpid" = "" ]; then
exit 143
fi
ps -p "$lastpid" >/dev/null 2>&1
if [ ! "$?" = "0" ]; then
## Already terminated.
exit 143
fi
kill -s sigterm "$lastpid"
exit 143
}
trap "sigterm_trap" SIGTERM SIGINT
timeout_after="240"
kill_after="10"
timeout \
--kill-after="$kill_after" \
"$timeout_after" \
/usr/lib/security-misc/apt-get-wrapper update &
lastpid="$!"
wait "$lastpid"
exit "$?"