Ignore:
Timestamp:
Jul 12, 2006, 12:40:18 AM (19 years ago)
Author:
Thorsten Glaser <tg@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
4486a95
Parents:
115d022
Message:
  • change the SYSV init system to add a target "autostart"
  • on system startup, call autostart instead of start
  • on autostart, check /etc/rc.conf for whether the service is enabled and act appropriately; fall through into start target
  • move some pre-startup checks into the start target
  • some whitespace cleanup, when it makes much sense (XXX when I get the person who wrote these scripts...)
  • optimise dropbear a little

ok and approved wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@191 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package/dropbear/files/dropbear.init

    r115d022 r583d755  
    33. /etc/rc.conf
    44
    5 if [ X"${ssh}" == X"NO" ]; then
    6         exit 0
    7 fi
    8 
    9 for type in rsa dss; do {
    10   # check for keys
    11   key=/etc/dropbear/dropbear_${type}_host_key
    12   [ ! -f $key ] && {
    13     # generate missing keys
    14     mkdir -p /etc/dropbear
    15     [ -x /usr/bin/dropbearkey ] && {
    16       /usr/bin/dropbearkey -t $type -f $key 2>&- >&- && exec $0 $*
    17     } &
    18     exit 0
    19   }
    20 }; done
    21 
    225case $1 in
     6autostart)
     7        test x"$ssh" = x"NO" && exit 0
     8        # FALLTHROUGH
    239start)
     10        # check for keys
     11        for type in rsa dss; do
     12                key=/etc/dropbear/dropbear_${type}_host_key
     13                [ -f $key ] || {
     14                        mkdir -p /etc/dropbear
     15                        [ -x /usr/bin/dropbearkey ] && {
     16                            /usr/bin/dropbearkey -t $type -f $key 2>&- >&- && \
     17                            exec $0 $*; } &
     18                        exit 0
     19                }
     20        done
    2421        /usr/sbin/dropbear -w
    2522        ;;
Note: See TracChangeset for help on using the changeset viewer.