source: freewrt/package/dropbear/files/dropbear.init@ 1908a07

freewrt_1_0 freewrt_2_0
Last change on this file since 1908a07 was 1908a07, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

merge changes from trunk

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@756 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 623 bytes
Line 
1#!/bin/sh
2
3. /etc/rc.conf
4
5case $1 in
6autostart)
7 test x"$ssh" = x"NO" && exit 0
8 exec $0 start
9 ;;
10start)
11 # check for keys
12 for type in rsa dss; do
13 key=/etc/dropbear/dropbear_${type}_host_key
14 [ -f $key ] || {
15 mkdir -p /etc/dropbear
16 [ -x /usr/bin/dropbearkey ] && {
17 /usr/bin/dropbearkey -t $type -f $key 2>&- >&-; \
18 rv=$?; \
19 fwcf commit 2>&1 | logger -t 'dropbear-fwcf'; \
20 [ $rv -eq 0 ] && exec $0 $*; } &
21 exit 0
22 }
23 done
24 /usr/sbin/dropbear -g
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.