-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·43 lines (36 loc) · 939 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·43 lines (36 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
maybe_build_key(){
if [ -f "/git/data/keys/ssh_host_$1_key" ]
then
echo "Found $1 Key...Done"
else
echo "Generating $1 Key..."
ssh-keygen -q -N '' -t $1 -f /git/data/keys/ssh_host_$1_key
cat /git/data/keys/ssh_host_$1_key.pub
echo "Generating $1 Key...Done"
fi
}
echo "Checking for Keys..."
for t in rsa dsa ecdsa ed25519; do
maybe_build_key $t
done
echo "Checking for Keys...Completed"
link_file(){
echo "Linking /git/data/users/git_$1..."
if [ ! -f "/git/data/users/git_$1" ]
then
cp /etc/$1 /git/data/users/git_$1
fi
ln -sf /git/data/users/git_$1 /etc/$1
echo "Linking /git/data/users/git_$1...Complete"
}
echo "Setup userdata..."
for f in passwd group shadow; do
link_file $f
done
echo "Setup userdata...Complete"
echo "Starting syslogd..."
/sbin/syslogd &
echo "Starting sshd..."
/usr/sbin/sshd &&
tail -F /var/log/*