OpenSDE Packages Database (without history before r20070)
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.

55 lines
1.5 KiB

  1. #!/bin/sh
  2. #
  3. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. #
  6. # Filename: package/.../openssh/sshd.init
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. #
  18. # Desc: secure shell daemon
  19. # Runlevel: 25 rcX
  20. #
  21. main_begin
  22. block_begin(start, `Starting sshd.')
  23. if ! test -e /etc/ssh/ssh_host_key -o \
  24. -e /etc/ssh/ssh_host_dsa_key -o \
  25. -e /etc/ssh/ssh_host_rsa_key
  26. then
  27. echo "Can't start sshd: No ssh host keys found !!"\
  28. "Please create the keys using either ssh-keygen or stone."
  29. IN error=1
  30. else
  31. check(`D_prefix/sbin/sshd')
  32. fi
  33. block_end
  34. block_begin(stop, `Stopping sshd.')
  35. check(`if [ -s /var/run/sshd.pid ] ; then
  36. kill -15 $(cat /var/run/sshd.pid)
  37. else
  38. echo "sshd is not running or /var/run/sshd.pid disappeared."
  39. error=1
  40. fi')
  41. block_end
  42. block_begin(restart, `Restarting sshd.')
  43. check(`if [ -s /var/run/sshd.pid ] ; then
  44. kill -HUP $(cat /var/run/sshd.pid)
  45. else
  46. echo "sshd is not running or /var/run/sshd.pid disappeared."
  47. error=1
  48. fi')
  49. block_end
  50. main_end