Closed amadotejada closed 1 year ago
Thanks big bunches, @amadotejada!
with drtaru's help, found that $welcomeBannerImage check will fail if the image is local to the file system rather than hosted somewhere else.
This will fail when the image is local.
if curl --output /dev/null --silent --head --fail "$welcomeBannerImage"; then updateScriptLog "WELCOME DIALOG: welcomeBannerImage is available, using it" else updateScriptLog "WELCOME DIALOG: welcomeBannerImage is not available, using a default image" welcomeBannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg" fi
This will succeed if the image is local.
# Check if the custom welcomeBannerImage is available, and if not, use a alternative image if [ -f "$welcomeBannerImage" ]; then updateScriptLog "WELCOME DIALOG: welcomeBannerImage is available, using it" else updateScriptLog "WELCOME DIALOG: welcomeBannerImage is not available, using a default image" welcomeBannerImage="https://img.freepik.com/free-photo/yellow-watercolor-paper_95678-448.jpg" fi
Thanks, @benphilware; I'll counsel with @amadotejada on how best to proceed.
I changed line 446 to if [ curl --output /dev/null --silent --head --fail "$welcomeBannerImage" ] || [ -f "$welcomeBannerImage" ]; then
to resolve this issue. This statement covers both remote and local images.
The Dialog fails to open if the banner/welcome images are not available. We use this to test the image URLs and set an alternative image if the default fails. Folks can add a second custom image as a backup.
Resubmit of: #21