Skip to content

Instantly share code, notes, and snippets.

@BolaNasr
Created May 5, 2020 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BolaNasr/632975d2cc8e121874915bc18dd8e3bd to your computer and use it in GitHub Desktop.
Save BolaNasr/632975d2cc8e121874915bc18dd8e3bd to your computer and use it in GitHub Desktop.
#!/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