2018-04-02 23:29:39 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function handle_int {
|
|
|
|
echo "Received SIGINT or SIGTERM, keep running for 15 seconds nevertheless"
|
|
|
|
sleep 15
|
|
|
|
exit -5
|
|
|
|
}
|
|
|
|
trap "handle_int" SIGINT SIGTERM
|
|
|
|
|
2021-06-09 20:59:09 +02:00
|
|
|
i=0
|
2018-04-02 23:29:39 +02:00
|
|
|
while [[ true ]]; do
|
2021-06-09 20:59:09 +02:00
|
|
|
echo "$i : $RANDOM"
|
|
|
|
i=$((i + 1))
|
2018-04-02 23:29:39 +02:00
|
|
|
sleep 1
|
|
|
|
done
|