Files
xserver-vnc/start.sh
T
2024-05-13 21:43:21 +02:00

23 lines
375 B
Bash
Executable File

#!/bin/bash
trap_with_arg() {
func="$1" ; shift
for sig ; do
echo "$func $sig"
trap "$func $sig" "$sig"
done
}
func_trap() {
echo "Trapped: $1"
echo "Killing ${PID}"
kill -9 -${PID}
}
trap_with_arg func_trap EXIT TERM HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM
./parent.sh &
PID=$$
echo "Pid = $PID"
sleep 10