mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

  1. #!/bin/sh
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/package/base/openssh/sshd.init
  11. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # Desc: secure shell daemon
  26. # Runlevel: 25 rcX
  27. #
  28. main_begin
  29. block_begin(start, `Starting sshd.')
  30. if ! test -e /etc/ssh/ssh_host_key -o \
  31. -e /etc/ssh/ssh_host_dsa_key -o \
  32. -e /etc/ssh/ssh_host_rsa_key
  33. then
  34. echo "Can't start sshd: No ssh host keys found !!"\
  35. "Please create the keys using either ssh-keygen or stone."
  36. IN error=1
  37. else
  38. check(`D_prefix/sbin/sshd')
  39. fi
  40. block_end
  41. block_begin(stop, `Stopping sshd.')
  42. check(`if [ -s /var/run/sshd.pid ] ; then
  43. kill -15 $(cat /var/run/sshd.pid)
  44. else
  45. echo "sshd is not running or /var/run/sshd.pid disappeared."
  46. error=1
  47. fi')
  48. block_end
  49. block_begin(restart, `Restarting sshd.')
  50. check(`if [ -s /var/run/sshd.pid ] ; then
  51. kill -HUP $(cat /var/run/sshd.pid)
  52. else
  53. echo "sshd is not running or /var/run/sshd.pid disappeared."
  54. error=1
  55. fi')
  56. block_end
  57. main_end