mirror of
https://github.com/ledgersmb/ledgersmb-docker.git
synced 2025-04-19 06:37:11 -04:00
Patch from dcg: detect /etc/ssmtp.conf changes inside update script, instead of touching a /tmp file
This commit is contained in:
parent
aa6a9d5b12
commit
11b9c43044
7
start.sh
7
start.sh
@ -1,11 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ -e /tmp/smtpconfig ]]; then
|
update_ssmtp.sh
|
||||||
echo "smtp configured."
|
|
||||||
else
|
|
||||||
update_ssmtp.sh
|
|
||||||
touch /tmp/smtpconfig
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -f ledgersmb.conf ]]; then
|
if [[ ! -f ledgersmb.conf ]]; then
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
ConfiguredComment='# install script update_ssmtp.sh has configured ssmtp'
|
||||||
|
grep -nc "$ConfiguredComment" /etc/ssmtp.conf && {
|
||||||
|
echo "smtp configured."
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s/\(root=\).*\$/\1$SSMTP_ROOT/g" \
|
-e "s/\(root=\).*\$/\1$SSMTP_ROOT/g" \
|
||||||
@ -10,3 +15,4 @@ sed -i \
|
|||||||
[ -z "$SSMTP_AUTH_PASS" ] || echo "AuthPass=$SSMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_AUTH_PASS" ] || echo "AuthPass=$SSMTP_AUTH_PASS" >> /etc/ssmtp/ssmtp.conf
|
||||||
[ -z "$SSMTP_AUTH_METHOD" ] || echo "AuthMethod=$SSMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_AUTH_METHOD" ] || echo "AuthMethod=$SSMTP_AUTH_METHOD" >> /etc/ssmtp/ssmtp.conf
|
||||||
[ -z "$SSMTP_FROMLINE_OVERRIDE" ] || echo "FromLineOverride=$SSMTP_FROMLINE_OVERRIDE" >> /etc/ssmtp/ssmtp.conf
|
[ -z "$SSMTP_FROMLINE_OVERRIDE" ] || echo "FromLineOverride=$SSMTP_FROMLINE_OVERRIDE" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
echo "$ConfiguredComment" >> /etc/ssmtp/ssmtp.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user