-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.sh
38 lines (32 loc) · 875 Bytes
/
setup.sh
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
#!/bin/bash
if [ "${PUBKEY}" = "" ] || [ "${USERNAME}" = "" ] || [ "${VHOSTNAME}" = "" ]; then
echo "You need to specify a ssh PUBKEY, a USERNAME and VHOSTNAME"
exit 1
fi
# Regenerate SSH keys
if [ -f "/root/.firstrun" ]; then
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
fi
# Install Docker and Buildstep Image
/usr/local/bin/wrapdocker
sleep 2
chmod 777 /var/run/docker.sock
if [ -f "/root/.firstrun" ]; then
cat /root/buildstep.tar.gz | gunzip -cd | docker import - progrium/buildstep
fi
# Install remaining dokku stuff
if [ -f "/root/.firstrun" ]; then
cd /root/dokku
make sshcommand
echo $PUBKEY | sshcommand acl-add dokku ${USERNAME}
echo $VHOSTNAME > /home/dokku/VHOST
fi
# Start SSH and Nginx
service ssh start
service nginx start
if [ -f "/root/.firstrun" ]; then
unlink /root/.firstrun
fi
# Open a shell
bash