Created
May 5, 2020 12:28
-
-
Save BolaNasr/632975d2cc8e121874915bc18dd8e3bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# prepare ssh | |
[ -d /etc/ssh/ ] && chmod 400 -R /etc/ssh/ | |
mkdir -p /run/sshd | |
[ -d /root/.ssh/ ] || mkdir /root/.ssh | |
chmod +x /opt/bin/* | |
mkdir -p /var/log/postgres | |
mkdir -p /var/log/gitea | |
mkdir -p /var/log/cron | |
echo "prepare postgres" | |
/bin/bash /opt/bin/postgres_entry.sh postgres | |
supervisord -c /etc/supervisor/supervisord.conf | |
# take a public key from output | |
if [[ -z ${pub_key} ]] ; then | |
echo pub_key does not set in env variables | |
else | |
[[ -d /data/git/.ssh/ ]] || mkdir -p /data/git/.ssh/ | |
echo $pub_key >> /data/git/.ssh/authorized_keys | |
chown git:git /data/git/.ssh/authorized_keys | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment