mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-24 13:19:27 -05:00
fix, show progress during apt-get-wrapper
fix, propagate signals to apt-get child process
This commit is contained in:
parent
49cde21078
commit
5653b7732a
2
debian/control
vendored
2
debian/control
vendored
@ -13,7 +13,7 @@ Standards-Version: 3.9.8
|
||||
|
||||
Package: security-misc
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}
|
||||
Depends: expect, ${misc:Depends}
|
||||
Replaces: tcp-timestamps-disable
|
||||
Description: enhances misc security settings
|
||||
The following settings are changed:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
## This file is part of Whonix.
|
||||
## Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net>
|
||||
## Copyright (C) 2012 - 2017 Patrick Schleizer <adrelanos@riseup.net>
|
||||
## See the file COPYING for copying conditions.
|
||||
|
||||
set -e
|
||||
@ -15,35 +15,28 @@ cleanup() {
|
||||
}
|
||||
|
||||
temp_dir="$(mktemp --directory)"
|
||||
|
||||
logfile="$temp_dir/log"
|
||||
tee_fifo="$temp_dir/tee_fifo"
|
||||
|
||||
trap "cleanup" EXIT
|
||||
|
||||
mkfifo "$tee_fifo"
|
||||
## TODO
|
||||
exec 2>&1
|
||||
|
||||
tee "$logfile" < "$tee_fifo" &
|
||||
tee_pid="$!"
|
||||
exec 3>&1
|
||||
exec 1> >(tee -a "$logfile")
|
||||
|
||||
apt-get \
|
||||
"$@" \
|
||||
1> "$tee_fifo" \
|
||||
2> "$tee_fifo" \
|
||||
&
|
||||
## TODO
|
||||
#exec 4>&2
|
||||
#exec 2> >(tee -a "$logfile")
|
||||
|
||||
apt_get_pid="$!"
|
||||
unbuffer apt-get "$@"
|
||||
|
||||
wait "$tee_pid"
|
||||
wait "$apt_get_pid"
|
||||
apt_get_exit_code="$?"
|
||||
|
||||
if [ ! "$apt_get_exit_code" = "0" ]; then
|
||||
exit "$apt_get_exit_code"
|
||||
fi
|
||||
|
||||
log="$(cat "$logfile")"
|
||||
|
||||
while read -r -d $'\n' line; do
|
||||
line_lower_case="${line,,}"
|
||||
first_two="${line_lower_case:0:2}"
|
||||
|
Loading…
Reference in New Issue
Block a user