mirror of
https://github.com/dockersrc/rust
synced 2026-08-09 08:01:38 -04:00
rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
##@Version : 202607082330-git
|
##@Version : 202607271325-git
|
||||||
# @@Author : Jason Hempstead
|
# @@Author : Jason Hempstead
|
||||||
# @@Contact : git-admin@casjaysdev.pro
|
# @@Contact : git-admin@casjaysdev.pro
|
||||||
# @@License : LICENSE.md
|
# @@License : LICENSE.md
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
# @@Created : Sunday, Sep 03, 2023 01:40 EDT
|
# @@Created : Sunday, Sep 03, 2023 01:40 EDT
|
||||||
# @@File : docker-entrypoint
|
# @@File : docker-entrypoint
|
||||||
# @@Description : functions for my docker containers
|
# @@Description : functions for my docker containers
|
||||||
# @@Changelog : newScript
|
# @@Changelog : fix __setup_mta calling __symlink with from/to swapped, which no-op'd the symlink and broke msmtp/ssmtp/postfix config on container start
|
||||||
# @@TODO : Refactor code
|
# @@TODO : Refactor code
|
||||||
# @@Other :
|
# @@Other :
|
||||||
# @@Resource :
|
# @@Resource :
|
||||||
@@ -1171,12 +1171,14 @@ from ${account_user:-root}@${account_domain:-$HOSTNAME}
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -f "/config/msmtp/msmtprc" ]; then
|
if [ -f "/config/msmtp/msmtprc" ]; then
|
||||||
__symlink "/config/msmtp/msmtprc" "/etc/msmtprc"
|
# __symlink(from, to) requires the "to" (config) side to already exist
|
||||||
|
# and creates "from" (etc) as a symlink to it — arguments were reversed here
|
||||||
|
__symlink "/etc/msmtprc" "/config/msmtp/msmtprc"
|
||||||
__initialize_replace_variables "/etc/msmtprc"
|
__initialize_replace_variables "/etc/msmtprc"
|
||||||
chmod 600 "/etc/msmtprc" 2>/dev/null || true
|
chmod 600 "/etc/msmtprc" 2>/dev/null || true
|
||||||
# sendmail compat symlink
|
# sendmail compat symlink
|
||||||
if [ ! -e "/usr/sbin/sendmail" ] && command -v msmtp &>/dev/null; then
|
if [ ! -e "/usr/sbin/sendmail" ] && command -v msmtp &>/dev/null; then
|
||||||
__symlink "$(command -v msmtp)" "/usr/sbin/sendmail"
|
__symlink "/usr/sbin/sendmail" "$(command -v msmtp)"
|
||||||
fi
|
fi
|
||||||
[ "$DEBUGGER" = "on" ] && echo "Done setting up msmtp"
|
[ "$DEBUGGER" = "on" ] && echo "Done setting up msmtp"
|
||||||
fi
|
fi
|
||||||
@@ -1204,17 +1206,19 @@ FromLineOverride=yes
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -f "/config/ssmtp/ssmtp.conf" ]; then
|
if [ -f "/config/ssmtp/ssmtp.conf" ]; then
|
||||||
|
# __symlink(from, to) requires the "to" (config) side to already exist
|
||||||
|
# and creates "from" (etc) as a symlink to it — arguments were reversed here
|
||||||
for file in $symlink_files; do
|
for file in $symlink_files; do
|
||||||
__symlink "/config/ssmtp/$file" "/etc/ssmtp/$file"
|
__symlink "/etc/ssmtp/$file" "/config/ssmtp/$file"
|
||||||
__initialize_replace_variables "/etc/ssmtp/$file"
|
__initialize_replace_variables "/etc/ssmtp/$file"
|
||||||
done
|
done
|
||||||
if [ -f "/etc/ssmtp/revaliases" ] && [ ! -f "/config/ssmtp/revaliases" ]; then
|
if [ -f "/etc/ssmtp/revaliases" ] && [ ! -f "/config/ssmtp/revaliases" ]; then
|
||||||
mv -f "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases"
|
mv -f "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases"
|
||||||
__symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases"
|
__symlink "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases"
|
||||||
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
||||||
else
|
else
|
||||||
touch "/config/ssmtp/revaliases"
|
touch "/config/ssmtp/revaliases"
|
||||||
__symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases"
|
__symlink "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases"
|
||||||
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
||||||
fi
|
fi
|
||||||
[ "$DEBUGGER" = "on" ] && echo "Done setting up ssmtp"
|
[ "$DEBUGGER" = "on" ] && echo "Done setting up ssmtp"
|
||||||
@@ -1255,8 +1259,10 @@ relayhost = [$relay_server]:$relay_port
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -d "/config/postfix" ]; then
|
if [ -d "/config/postfix" ]; then
|
||||||
|
# __symlink(from, to) requires the "to" (config) side to already exist
|
||||||
|
# and creates "from" (etc) as a symlink to it — arguments were reversed here
|
||||||
for f in $symlink_files; do
|
for f in $symlink_files; do
|
||||||
__symlink "/config/postfix/$f" "/etc/postfix/$f"
|
__symlink "/etc/postfix/$f" "/config/postfix/$f"
|
||||||
done
|
done
|
||||||
__initialize_replace_variables "/etc/postfix"
|
__initialize_replace_variables "/etc/postfix"
|
||||||
touch "/config/postfix/aliases" "/config/postfix/mynetworks" "/config/postfix/transport"
|
touch "/config/postfix/aliases" "/config/postfix/mynetworks" "/config/postfix/transport"
|
||||||
|
|||||||
Reference in New Issue
Block a user