source: freewrt/package/dropbear/files/dropbear.init@ 7e7215cf

freewrt_1_0 freewrt_2_0
Last change on this file since 7e7215cf was 7e7215cf, checked in by Markus Wigge <markus@…>, 19 years ago

moved dropbear startup config to /etc/rc.conf, synced double quotes from trunk

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

  • Property mode set to 100755
File size: 638 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 dss; 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.