#!/bin/bash
if [ $# -ne 0 ]; then
>&2 echo 'check-if-bareos-backup-is-running: too many arguments'
exit 2
fi
if cat /proc/net/tcp* \
| awk '{print $3}' \
| cut -d: -f2 \
| grep -qxiF '238F'; then
>&2 echo 'bareos-fd is connected to bareos-sd'
exit 1
else
>&2 echo 'bareos-fd is not connected to bareos-sd'
fi