• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/dropbear/S50dropbear
Maxime HadjinlianMaxime Hadjinlian committed 0f75b2635ee03 Oct 2015
Raw file
Source viewDiff to previous
 
1
#!/bin/sh
2
#
3
# Starts dropbear sshd.
4
#
5
​
6
# Allow a few customizations from a config file
7
test -r /etc/default/dropbear && . /etc/default/dropbear
8
​
9
start() {
10
    DROPBEAR_ARGS="$DROPBEAR_ARGS -R"
11
​
12
    # If /etc/dropbear is a symlink to /var/run/dropbear, and
13
    #   - the filesystem is RO (i.e. we can not rm the symlink),
14
    #     create the directory pointed to by the symlink.
15
    #   - the filesystem is RW (i.e. we can rm the symlink),
16
    #     replace the symlink with an actual directory
17
    if [ -L /etc/dropbear \
18
         -a "$(readlink /etc/dropbear)" = "/var/run/dropbear" ]
19
    then
20
        if rm -f /etc/dropbear >/dev/null 2>&1; then
21
            mkdir -p /etc/dropbear
22
        else
23
            echo "No persistent location to store SSH host keys. New keys will be"
24
            echo "generated at each boot. Are you sure this is what you want to do?"
25
            mkdir -p "$(readlink /etc/dropbear)"
26
        fi
27
    fi
28
​
29
    printf "Starting dropbear sshd: "
30
    umask 077
31
​
32
    start-stop-daemon -S -q -p /var/run/dropbear.pid \
33
        --exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
34
    [ $? = 0 ] && echo "OK" || echo "FAIL"
35
}
36
stop() {
37
    printf "Stopping dropbear sshd: "
38
    start-stop-daemon -K -q -p /var/run/dropbear.pid
39
    [ $? = 0 ] && echo "OK" || echo "FAIL"
40
}
41
restart() {
42
    stop
43
    start
44
}
45
​
46
case "$1" in
47
  start)
48
    start
49
    ;;
50
  stop)
51
    stop
52
    ;;
53
  restart|reload)
54
    restart
55
    ;;
56
  *)
57
    echo "Usage: $0 {start|stop|restart}"
58
    exit 1
59
esac
60
​
61
exit $?
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.