#!/bin/bash

crontabSetupSystemInfoUpdater() 
{
  local cronEntry="* * * * * libreportal webui generate system >/dev/null 2>&1"
  
  # Check if already in crontab
  if runAsManager crontab -l 2>/dev/null | grep -q "libreportal webui generate system"; then
    isNotice "System info updater already in crontab"
  else
    # Add to crontab
    (runAsManager crontab -l 2>/dev/null; echo "$cronEntry") | runAsManager crontab -
    isSuccessful "System info updater added to crontab (every 1 minute)."
  fi
}
