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.

27 lines
723 B

  1. #!/usr/bin/env /lib/init/init-d-script
  2. ### BEGIN INIT INFO
  3. # Provides: dqcache
  4. # Required-Start: $syslog $time networking
  5. # Required-Stop: $syslog $time networking
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Tiny SSH Daemon
  9. # Description: Init script to start/stop a tinysshd via socat daemon
  10. ### END INIT INFO
  11. DESC="Tiny SSHD via socat"
  12. NAME="socat(tinysshd)"
  13. DAEMON=none
  14. TINYSSHKEYS=/etc/tinyssh/keys
  15. do_start_cmd() {
  16. [ -d "$TINYSSHKEYS" ] || /usr/sbin/tinysshd-makekey "$TINYSSHKEYS"
  17. exec /usr/bin/socat -lptinysshd \
  18. tcp4-listen:22,fork exec:"/usr/sbin/tinysshd -l -v $TINYSSHKEYS" \
  19. <&- 2>&- >&- &
  20. }
  21. do_stop_cmd() {
  22. pkill -f lptinysshd
  23. }