Files
ai-setup/test_sigint.sh
2026-06-30 12:12:42 +07:00

12 lines
417 B
Bash
Executable File

#!/bin/bash
# Copyright (c) 2026 Виталий Никитенко. MIT License.
python3 -c "import time; print('python started'); time.sleep(100)" &
py_pid=$!
node -e "
console.log('node started');
process.on('SIGINT', () => console.log('node caught sigint'));
setTimeout(() => console.log('node done'), 10000);
"
echo "checking python"
kill -0 $py_pid 2>/dev/null && echo "python alive" || echo "python dead"