move trap to better place
This commit is contained in:
@@ -48,7 +48,6 @@ function siprefix() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function animate() {
|
function animate() {
|
||||||
trap "trap - SIGTERM && kill -- -$$" EXIT SIGINT SIGTERM
|
|
||||||
CHARS=( "| " "/ " " _ " " \\" " |" " \\" " _ " "/ " )
|
CHARS=( "| " "/ " " _ " " \\" " |" " \\" " _ " "/ " )
|
||||||
i=0
|
i=0
|
||||||
while true; do
|
while true; do
|
||||||
@@ -109,6 +108,7 @@ fi
|
|||||||
[[ "${#what[@]}" -eq 1 ]] && SUMMARY=1
|
[[ "${#what[@]}" -eq 1 ]] && SUMMARY=1
|
||||||
|
|
||||||
if [[ "$ANIMATE" -eq 1 ]]; then
|
if [[ "$ANIMATE" -eq 1 ]]; then
|
||||||
|
trap 'trap - SIGTERM && kill -- -$$' EXIT SIGINT SIGTERM
|
||||||
animate &
|
animate &
|
||||||
fi
|
fi
|
||||||
[[ "$HUMAN" -eq 1 ]] && NUMFORMAT="%7s "
|
[[ "$HUMAN" -eq 1 ]] && NUMFORMAT="%7s "
|
||||||
@@ -131,6 +131,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$ANIMATE" -eq 1 ]]; then
|
if [[ "$ANIMATE" -eq 1 ]]; then
|
||||||
|
trap - EXIT SIGINT SIGTERM
|
||||||
kill %1
|
kill %1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user