
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
#!/bin/bash
# https://jira.a2hosting.com/browse/SYSENG-2654
# production/states/virtuozzo/7/repo/usr/lib/check_mk_agent/scripts/vz7_backup_timer_enabled_on_check.sh.vz7

ENABLED=$(systemctl status vz7-backup.timer | awk '/Loaded/ {print $4}' | cut -d ";" -f 1)
RUNNING=$(systemctl status vz7-backup.timer | awk '/Active/ {print $2}')

if [[ "$ENABLED" == "enabled" ]] && [[ "$RUNNING" == "active" ]]; then
  echo "vz7_backup_timer_enabled_on_check - vz7_backup_timer running and enabled."
  exit 0
else
  echo "vz7_backup_timer_enabled_on_check - vz7_backup_timer not running or not enabled!"
  exit 2
fi
