#!/bin/bash
# chkconfig: 345 85 15
# description: ProFTPD FTP server (systemd-managed; this is a compatibility wrapper)
#
# Legacy SysV wrapper. proftpd is managed by systemd; this exists so callers
# that hardcode /etc/init.d/proftpd keep working. The chkconfig header above is
# required: because this script exists, `systemctl enable proftpd` routes
# enablement through systemd-sysv-install (chkconfig) on EL7-EL9. Without the
# header that redirect fails ("does not support chkconfig") and the unit is
# never enabled.
case "$1" in
    start|stop|restart|reload|status)
        exec systemctl "$1" proftpd.service
        ;;
    condrestart|try-restart)
        exec systemctl try-restart proftpd.service
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|reload|condrestart|try-restart|status}"
        exit 2
        ;;
esac
