Advertisement
Guest User

proftpd startup

a guest
Mar 31st, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.60 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # proftpd       This shell script takes care of starting and stopping
  4. #               proftpd.
  5. #
  6. # chkconfig: - 80 30
  7. # description: ProFTPd is an enhanced FTP server with a focus towards \
  8. #              simplicity, security, and ease of configuration. \
  9. #              It features a very Apache-like configuration syntax, \
  10. #              and a highly customizable server infrastructure, \
  11. #              including support for multiple 'virtual' FTP servers, \
  12. #              anonymous FTP, and permission-based directory visibility.
  13. # processname: proftpd
  14. # config: /etc/proftp.conf
  15. # pidfile: /var/run/proftpd.pid
  16.  
  17. ### BEGIN INIT INFO
  18. # Provides: proftpd ftpserver
  19. # Required-Start: $local_fs $network $named $remote_fs
  20. # Required-Stop: $local_fs $network $named $remote_fs
  21. # Short-Description: ProFTPd FTP Server
  22. # Description: ProFTPd is an enhanced FTP server with a focus towards
  23. #       simplicity, security, and ease of configuration.
  24. #       It features a very Apache-like configuration syntax,
  25. #       and a highly customizable server infrastructure,
  26. #       including support for multiple 'virtual' FTP servers,
  27. #       anonymous FTP, and permission-based directory visibility.
  28. ### END INIT INFO
  29.  
  30. # Source function library.
  31. . /etc/rc.d/init.d/functions
  32.  
  33. # Source networking configuration.
  34. . /etc/sysconfig/network
  35.  
  36. # Source ProFTPD configuration.
  37. PROFTPD_OPTIONS=""
  38. if [ -f /etc/sysconfig/proftpd ]; then
  39.         . /etc/sysconfig/proftpd
  40. fi
  41.  
  42. # Check that networking is up.
  43. [ ${NETWORKING} = "no" ] && exit 1
  44.  
  45. [ -x /usr/sbin/proftpd ] || exit 5
  46.  
  47. RETVAL=0
  48.  
  49. prog="proftpd"
  50.  
  51. start() {
  52.         echo -n $"Starting $prog: "
  53.         daemon proftpd $PROFTPD_OPTIONS 2>/dev/null
  54.         RETVAL=$?
  55.         echo
  56.         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
  57. }
  58.  
  59. stop() {
  60.         echo -n $"Shutting down $prog: "
  61.         killproc proftpd
  62.         RETVAL=$?
  63.         echo
  64.         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
  65. }
  66.  
  67. # See how we were called.
  68. case "$1" in
  69.   start)
  70.         start
  71.         ;;
  72.   stop)
  73.         stop
  74.         ;;
  75.   status)
  76.         status proftpd
  77.         RETVAL=$?
  78.         ;;
  79.   restart)
  80.         stop
  81.         start
  82.         ;;
  83.   try-restart|condrestart)
  84.         if [ -f /var/lock/subsys/proftpd ]; then
  85.           stop
  86.           start
  87.         fi
  88.         ;;
  89.   reload|force-reload)
  90.         echo -n $"Re-reading $prog configuration: "
  91.         killproc proftpd -HUP
  92.         RETVAL=$?
  93.         echo
  94.         ;;
  95.   *)
  96.         echo "Usage: $prog {start|stop|restart|try-restart|reload|status}"
  97.         exit 2
  98. esac
  99.  
  100. exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement