mirror of
https://github.com/gaoyifan/china-operator-ip.git
synced 2025-07-13 21:02:37 +08:00
exit with non-zero child thread status code
This commit is contained in:
parent
82653dcf0e
commit
6f9976598d
15
common.sh
15
common.sh
@ -38,5 +38,18 @@ prepare_data(){
|
||||
curl -sSL https://bgp.potaroo.net/cidr/autnums.html | awk '-F[<>]' '{print $3,$5}' | grep '^AS' > asnames.txt &
|
||||
prepare_data_v4 &
|
||||
prepare_data_v6 &
|
||||
wait
|
||||
wait_exit
|
||||
}
|
||||
|
||||
wait_exit(){
|
||||
local oldstate=$(set +o)
|
||||
set +e
|
||||
local s=0
|
||||
while [[ $s -ne 127 ]]; do
|
||||
[[ $s -ne 0 ]] && exit $s
|
||||
wait -n
|
||||
s=$?
|
||||
done
|
||||
eval "$oldstate"
|
||||
return 0
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ for file in operator/*.conf; do
|
||||
get_asn $file | xargs bgptools -b rib6.txt | cidr-merger -s > result/${operator}6.txt &
|
||||
done
|
||||
|
||||
wait
|
||||
wait_exit
|
||||
|
Loading…
Reference in New Issue
Block a user