# If I knew how to use the "SMGL-script-version" function I could
#   have made this better. Feel free to modify.

# Create fcrontab -- only if it doesn't already exist.
if  [  !  -e  /etc/fcrontab  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/fcrontab${DEFAULT_COLOR}"
  cp  $SCRIPT_DIRECTORY/files/crontab.example  /etc/fcrontab
fi  &&

# Everything after this should be the same -- this script assumes that other
#   cron-daemons have different formats for their "crontab"

# Create the correct dirs -- if they don't exist.
if  [  !  -e  /etc/cron  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron${DEFAULT_COLOR}"
  mkdir  /etc/cron
fi  &&

if  [  !  -e  /etc/cron/2minutely  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/2minutely${DEFAULT_COLOR}"
  mkdir  /etc/cron/2minutely
fi  &&

if  [  !  -e  /etc/cron/5minutely  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/5minutely${DEFAULT_COLOR}"
  mkdir  /etc/cron/5minutely
fi  &&

if  [  !  -e  /etc/cron/daily  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/daily${DEFAULT_COLOR}"
  mkdir  /etc/cron/daily
fi  &&

if  [  !  -e  /etc/cron/hourly  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/hourly${DEFAULT_COLOR}"
  mkdir  /etc/cron/hourly
fi  &&

if  [  !  -e  /etc/cron/monthly  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/monthly${DEFAULT_COLOR}"
  mkdir  /etc/cron/monthly
fi  &&

if  [  !  -e  /etc/cron/weekly  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/weekly${DEFAULT_COLOR}"
  mkdir  /etc/cron/weekly
fi  &&

if  [  !  -e  /etc/cron/yearly  ];  then
  message  "${MESSAGE_COLOR}Creating ${FILE_COLOR}/etc/cron/yearly${DEFAULT_COLOR}"
  mkdir  /etc/cron/yearly
fi
