added missing file

This commit is contained in:
Miłosz Stocki 2020-03-04 21:02:49 +01:00
parent b4e066f032
commit 5b029a2cf8
Signed by: osiu97
GPG Key ID: E3D1D83FA04F51D6
1 changed files with 24 additions and 0 deletions

24
entrypoint.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
#dpkg-reconfigure openssh-server
if [ -n "${BORG_UID}" ]; then
usermod -u ${BORG_UID} borg
fi
if [ -n "${BORG_GID}" ]; then
groupmod -o -g ${BORG_GID} borg
usermod -g ${BORG_GID} borg
fi
if [ ! -z ${BORG_AUTHORIZED_KEYS+x} ]; then
mkdir /home/borg/.ssh
echo -e $BORG_AUTHORIZED_KEYS > /home/borg/.ssh/authorized_keys
chown borg.borg /home/borg/.ssh/authorized_keys
chmod og-rwx /home/borg/.ssh/authorized_keys
fi
chown -R borg.borg /home/borg
chown -R borg.borg /home/borg/.ssh
exec /usr/sbin/sshd -D -e