SourceForge.net Logo

B.20. /etc/init.d/dropbear

#!/bin/ash

# GPL $Id: dropbear,v 1.2 2005/03/22 15:06:14 cvonk Exp $
# system init for SSH server (dropbear)

case "$1" in
    start)
        dropbear -s -d /etc/sysconfig/dropbear/dss_host_key \
                    -r /etc/sysconfig/dropbear/rsa_host_key
        ;;
    stop)
        killall dropbear 2>/dev/null
        ;;
    restart)
	$0 stop
	$0 start
	;;
    status)
        if pidof dropbear | sed "s/$$\$//" | grep -q [0-9] ; then
	    echo "running"
        else
	    echo "stopped"
        fi
        ;;
esac

Example B.20. /etc/init.d/dropbear