#!/bin/bash
exit_script() {
echo "Printing something special!"
echo "Maybe executing other commands!"
trap - SIGINT SIGTERM # clear the trap
kill -- -$$ # Sends SIGTERM to child/sub processes }
trap exit_script SIGINT SIGTERM
echo "Some other text"
#other commands here
sleep infinity
Systemctl status freeradius
nc -z -v -u [hostname/IP address] [port number]