mirror of
https://github.com/casjaysdevdocker/proftpd
synced 2025-01-18 06:34:24 -05:00
51 lines
1.6 KiB
Bash
51 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
##@Version : 202202021753-git
|
|
# @Author : Jason Hempstead
|
|
# @Contact : jason@casjaysdev.com
|
|
# @License : WTFPL
|
|
# @ReadME : entrypoint.sh --help
|
|
# @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
|
|
# @Created : Wednesday, Feb 02, 2022 17:53 EST
|
|
# @File : entrypoint.sh
|
|
# @Description :
|
|
# @TODO :
|
|
# @Other :
|
|
# @Resource :
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
# Set bash options
|
|
[ -n "$DEBUG" ] && set -x
|
|
set -o pipefail
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
APPNAME="$(basename "$0")"
|
|
VERSION="202202021753-git"
|
|
USER="${SUDO_USER:-${USER}}"
|
|
HOME="${USER_HOME:-${HOME}}"
|
|
SRC_DIR="${BASH_SOURCE%/*}"
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
export TZ="${TZ:-America/New_York}"
|
|
export HOSTNAME="${HOSTNAME:-casjaysdev-proftpd}"
|
|
|
|
[ -n "${TZ}" ] && echo "${TZ}" >/etc/timezone
|
|
[ -n "${HOSTNAME}" ] && echo "${HOSTNAME}" >/etc/hostname
|
|
[ -n "${HOSTNAME}" ] && echo "127.0.0.1 $HOSTNAME localhost" >/etc/hosts
|
|
[ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime"
|
|
|
|
[ -f "/config/ssl/ca.crt" ] || create-ssl-cert
|
|
[ -f "/config/proftpd.conf" ] &&
|
|
cp -Rf /config/proftpd.conf /etc/proftpd/proftpd.conf ||
|
|
cp -Rf /etc/proftpd/proftpd.conf /config/proftpd.conf
|
|
|
|
case $1 in
|
|
healthcheck)
|
|
echo 'OK'
|
|
;;
|
|
bash | shell | sh)
|
|
shift 1
|
|
exec /bin/bash -l "$@"
|
|
;;
|
|
*)
|
|
exec proftpd --nodaemon -c /etc/proftpd/proftpd.conf || bash -l
|
|
;;
|
|
esac
|