#!/bin/bash

crontabSetup() 
{
    local search_line="# cron is set up for $sudo_user_name"
    local cron_output=$(runAsManager crontab -l 2>/dev/null)

    if [[ ! $cron_output == *"$search_line"* ]]; then
        local result=$( (runAsManager crontab -l 2>/dev/null; echo "# cron is set up for $sudo_user_name") | runAsManager crontab - 2>/dev/null )
        checkSuccess "Setting up Crontab for $sudo_user_name user"
    fi

    export VISUAL=$CFG_TEXT_EDITOR
    export EDITOR=$CFG_TEXT_EDITOR
}