2016-12-25 01:29:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
## This file is part of Whonix.
|
|
|
|
## Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net>
|
|
|
|
## See the file COPYING for copying conditions.
|
|
|
|
|
|
|
|
sigterm_trap() {
|
|
|
|
if [ "$lastpid" = "" ]; then
|
|
|
|
exit 143
|
|
|
|
fi
|
|
|
|
ps -p "$lastpid"
|
|
|
|
if [ ! "$?" = "0" ]; then
|
|
|
|
## Already terminated.
|
|
|
|
exit 143
|
|
|
|
fi
|
|
|
|
kill -sigterm "$lastpid"
|
|
|
|
exit 143
|
|
|
|
}
|
|
|
|
|
|
|
|
trap "sigterm_trap" SIGTERM
|
|
|
|
|
|
|
|
timeout_after="120"
|
|
|
|
kill_after="10"
|
|
|
|
|
|
|
|
timeout \
|
|
|
|
--kill-after="$kill_after" \
|
|
|
|
"$timeout_after" \
|
2016-12-25 01:36:04 +00:00
|
|
|
/usr/lib/security-misc/apt-get-wrapper update &
|
2016-12-25 01:29:31 +00:00
|
|
|
|
|
|
|
lastpid="$!"
|
|
|
|
wait "$lastpid"
|
|
|
|
|
|
|
|
exit "$?"
|