This repository has been archived on 2020-09-19. You can view files and clone it, but cannot push or open issues or pull requests.
Files
docker-lfs/scripts/start-server.sh

33 lines
1.1 KiB
Bash

#!/bin/bash
if [ ! -f ${DATA_DIR}/wget-list ]; then
cp /tmp/wget-list ${DATA_DIR}
else
rm -f ${DATA_DIR}/wget-list
cp /tmp/wget-list ${DATA_DIR}
fi
if [ ! -d /${DATA_DIR}/.ssh ]; then
mkdir -p /${DATA_DIR}/.ssh
fi
if [ ! -f /${DATA_DIR}/.ssh/ssh_host_rsa_key ]; then
echo "---No ssh_host_rsa_key found, generating!---"
ssh-keygen -f /${DATA_DIR}/.ssh/ssh_host_rsa_key -t rsa -b 4096 -N ""
else
echo "---ssh_host_rsa_key keys found!---"
fi
if [ ! -f /${DATA_DIR}/.ssh/ssh_host_ecdsa_key ]; then
echo "---No ssh_host_ecdsa_key found, generating!---"
ssh-keygen -f /${DATA_DIR}/.ssh/ssh_host_ecdsa_key -t ecdsa -b 521 -N ""
else
echo "---ssh_host_ecdsa_key found!---"
fi
if [ ! -f /${DATA_DIR}/.ssh/ssh_host_ed25519_key ]; then
echo "---No ssh_host_ed25519_key found, generating!---"
ssh-keygen -f /${DATA_DIR}/.ssh/ssh_host_ed25519_key -t ed25519 -N ""
else
echo "---ssh_host_ed25519_key found!---"
fi
echo "---Starting ssh daemon---"
/usr/sbin/sshd
sleep 2
echo "---Container fully startet, connect to it via SSH on the choosen port---"
sleep infinity