#!/bin/sh
# Unregister fcron from being a daemon (auto start by system: SysV, etc)
#


PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
if test -d /usr/ucb; then
    PATH=/usr/ucb:$PATH
fi

if test `uname -s` = "FreeBSD"; then
  rm -f /usr/local/etc/rc.d/fcron.sh
elif test -d /lib/systemd/system ; then
  rm -f /lib/systemd/system/fcron.service
  systemctl daemon-reload
elif test -d /usr/lib/systemd/system ; then
  rm -f /usr/lib/systemd/system/fcron.service
  systemctl daemon-reload
else
  INIT_D_ROOTDIR=""
  if test -f /etc/rc.d/init.d/fcron; then
    INIT_D_ROOTDIR="/etc/rc.d"
  elif test -f /etc/init.d/fcron; then
    INIT_D_ROOTDIR="/etc"
  fi
  if test $INIT_D_ROOTDIR != ""; then
    rm -f $INIT_D_ROOTDIR/init.d/fcron

    for i in 0 1 2 3 4 5 6
    do
    rm -f $INIT_D_ROOTDIR/rc$i.d/???fcron
    done

  else
    echo
    echo "You should delete fcron from your boot script manually"
    echo
  fi
fi

