dropbear 712 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # Start dropbear services - Freon Linux
  3. . /etc/conf.d/status
  4. DROPBEAR_PORT=22
  5. DROPBEAR_RSAKEY=/etc/dropbear/dropbear_rsa_host_key
  6. DROPBEAR_DSSKEY=/etc/dropbear/dropbear_dss_host_key
  7. DROPBEAR_RECEIVE_WINDOW=65535
  8. if [ ! -f /etc/dropbear/dropbear_rsa_host_key ]; then
  9. dropbearkey -t rsa -f $DROPBEAR_RSAKEY
  10. fi
  11. if [ ! -f /etc/dropbear/dropbear_dss_host_key ]; then
  12. dropbearkey -t dss -f $DROPBEAR_DSSKEY
  13. fi
  14. case $1 in
  15. start ) echo -n "Starting dropbear services..."; dropbear -d $DROPBEAR_DSSKEY -r $DROPBEAR_RSAKEY -p $DROPBEAR_PORT -W $DROPBEAR_RECEIVE_WINDOW; status;;
  16. stop ) echo -n "Stopping dropbear services..."; killall dropbear; status;;
  17. * ) echo "Usage: dropbear [start|stop].";;
  18. esac