Script for automating using lego with AdGuard Home

I followed the following script to generate for automating using lego with AdGuard Home.

it downloads the latest available release of lego, runs it and obtains a wildcard certificate for the specified domain;
I am trying to generate cert for a domain from duckdns

However, i get below error ./lego.sh not found

How to run the script correctly?

  1. It appears /opt/lego is an already existing directory.
    • ls -l /opt/lego will show its contents.
  2. ls -l ~ will show the contents of the root user’s home directory.
    • I suspect lego.sh wasn’t properly download loaded for some reason.