Skip to content

Commit 61bb8a8

Browse files
committed
Merge pull request #1 manually
2 parents 0674db5 + 2826022 commit 61bb8a8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

start.sh

100644100755
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/sh
22

3+
_term() {
4+
echo "Caught SIGTERM signal!"
5+
kill -TERM "$child" 2>/dev/null
6+
}
7+
8+
trap _term SIGTERM
9+
10+
# generate host keys, if required
311
ssh-keygen -A
412

513
# If there are some public keys in keys folder
@@ -20,5 +28,7 @@ if [ "$(ls -A /git-server/repos/)" ]; then
2028
find /git-server/repos -type d -exec chmod g+s '{}' +
2129
fi
2230

23-
# -D flag avoids executing sshd as a daemon
24-
/usr/sbin/sshd -D
31+
/usr/sbin/sshd -D &
32+
33+
child=$!
34+
wait "$child"

0 commit comments

Comments
 (0)