3 # Written by Tollef Fog Heen <tfheen@err.no>
4 # Based on code by Peter Palfrader
6 # Restart the given bacula director when it's idle.
12 if [ "$1" = "fd" ];then
15 elif [ "$1" = "sd" ]; then
22 echo "Restart bacula fd or sd when idle"
27 # returns true (0) if there are connections to that port.
29 local port="$1"; shift
30 local con="$(ss -nt "sport = :$port" | wc -l)"
31 if [ "$con" -gt 1 ]; then
38 while chk_net "$PORT"; do