source: freewrt/package/dropbear/files/dropbear.init@ 65ef133

freewrt_2_0
Last change on this file since 65ef133 was 65ef133, checked in by Waldemar Brodkorb <wbx@…>, 4 months ago

dropbear: update to latest

  • Property mode set to 100755
File size: 648 bytes
Line 
1#!/bin/sh
2
3. /etc/rc.conf
4
5case $1 in
6autostart)
7 test x"${ssh:-NO}" = x"NO" && exit 0
8 [ -x /usr/sbin/sshd -o x"$openssh" = x"YES" ] && exit 0
9 exec $0 start
10 ;;
11start)
12 # check for keys
13 for type in rsa ecdsa ed25519; do
14 key=/etc/dropbear/dropbear_${type}_host_key
15 [ -f $key ] || {
16 mkdir -p /etc/dropbear
17 [ -x /usr/bin/dropbearkey ] && {
18 /usr/bin/dropbearkey -t $type -f $key 2>&- >&-; \
19 rv=$?; \
20 [ $rv -eq 0 ] && exec $0 $*; } &
21 exit 0
22 }
23 done
24 /usr/sbin/dropbear $ssh_opts
25 ;;
26stop)
27 killall dropbear
28 ;;
29restart)
30 $0 stop
31 $0 start
32 ;;
33*)
34 echo "Usage: $0 {start | stop | restart}"
35 exit 1
36 ;;
37esac
38exit $?
Note: See TracBrowser for help on using the repository browser.