summaryrefslogtreecommitdiff
path: root/bareos/check-if-bareos-backup-is-running
blob: bb513e653ad5c33f7480ffdb4373ba6c6fa73caa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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