Closed cruisemaniac closed 7 years ago
Can you propose a solution?
lets start with a set -e
and simple traps...
if [[ -n "$input" ]] ; then
echo "error happened with input"
exit 1
fi
Let me know if this will work?
And I'd presume, that since we're heading with docker, all inputs should be captured and validated BEFORE SCRIPT START...
This should be applicable to post_install.sh too.
The current command for running is
docker run -itd -p=110:110 -p=25:25 -p=995:995 -p=80:80 -p=443:443 -p=587:587 -p=993:993 -p=143:143 -p=465:465 -h "test.example.com" --name="easymail" XXXXXX /bin/sh -c "bash /opt/easymail/post_install.sh test.example.com; exec /bin/bash"
We can make that to
docker run -itd -p=110:110 -p=25:25 -p=995:995 -p=80:80 -p=443:443 -p=587:587 -p=993:993 -p=143:143 -p=465:465 -h "test.example.com" --name="easymail" XXXXXX /bin/sh -c "bash /opt/easymail/post_install.sh; exec /bin/bash"
And after that inside in post_install.sh we can take the "test.example.com" from the hostname.
Is that your proposal?
yes that is...
That's great. I totally agree with you. Can you provide a Pull request for this changes?
@cruisemaniac the issue is resolved on v1.0.9, closing the ticket.
The installer proceeds with
NULL
value for hostname if user presses enter (without entering any value) when asked to "Enter Hostname".System should not proceed or should Ideally pick up the -H parameter that is provided when docker container is created:
What / where is the -h paramter used for ?