Closed hanss50 closed 3 years ago
That looks fine to me, what kind of hardware and unifi-os version are you running?
That looks fine to me, what kind of hardware and unifi-os version are you running?
info output: Model: UniFi Dream Machine PRO Version: 1.8.5.2964
I'd say check the format of your udm-le.env
file to make sure you don't have any syntax errors in there, that's all I can think of that would be causing it to error possibly.
Here is my config (with mydomain, user, CloudFlare token in place of what I put). Unless the CloudFlare token needs single quotes around it (I don't think I took those out), I don't see any syntax issues.
CERT_EMAIL='user@mydomain.net'
CERT_HOSTS='unifi.mydomain.net'
ENABLE_CAPTIVE='no'
CLOUDFLARE_DNS_API_TOKEN=my cloudflare token DNS_PROVIDER='cloudflare'
DNS_RESOLVERS=''
UDM_LE_PATH='/mnt/data/udm-le'
CERT_IMPORT_CMD='java -jar /usr/lib/unifi/lib/ace.jar import_key_cert' UBIOS_CERT_PATH='/mnt/data/unifi-os/unifi-core/config' UNIFIOS_CERT_PATH='/data/unifi-core/config'
I noticed a space between the . and the / in the udm-le.sh script (on line 4 that it's compaining about). Should that space be there?
Yeah the space is intentional, .
is a shell equivalent to source
.
Hi, I'm just getting my feet wet with these kinds of mods and found this thread and wanted to try to help out if I could.
I intentionally sabotaged line 4 of my /mnt/data/udm-le-master/udm-le.sh shell script (inserted a stray letter in the file path to get it to fail; unrelated, I chose to keep the folder name the same as the extracted zip archive of this repo) and it returned this error:
/mnt/data/udm-le-master/udm-le.sh: .: line 6: can't open '/qmnt/data/udm-le-master/udm-le.env': No such file or directory
I also noticed that line 4 of my shell script is an empty space--I had spaces surrounding the set -e
#!/bin/sh
`
set -e
# Load environment variables
. /mnt/data/udm-le-master/udm-le.env`
Whereas @hanss50 initial post didn't seem to have spaces there. Also, the reported error message appeared to have a typo:
: not founddm-le/udm-le.sh: /mnt/data/udm-le/udm-le.env: line 4:
I'm not sure if that might help identify the source of the problem. In my adventures here, I've also come to prefer editing these sorts of files via the vi text editor, as I have found that copying/pasting some characters (like the single quotes from line 4 of the udm-le.env file) can cause issues.
I hope this helps. Thanks @kchristensen for developing this!
Good idea, I hadn't considered people were copy and pasting this vs curling it off of github, downloading a zip, or cloning it.
Running the command gives:
/mnt/data/udm-le/udm-le.sh initial
: not founddm-le/udm-le.sh: /mnt/data/udm-le/udm-le.env: line 4:
First 4 lines of udm-le.sh :
!/bin/sh
set -e
Load environment variables
. /mnt/data/udm-le/udm-le.env
ls -l of /mnt/data/udm-le/ -rw-r--r-- 1 root root 5225 Jan 6 01:50 CODE_OF_CONDUCT.md -rw-r--r-- 1 root root 1073 Jan 6 01:50 LICENSE -rw-r--r-- 1 root root 2966 Jan 6 01:50 README.md drwxr-xr-x 2 root root 4096 Jan 6 01:53 on_boot.d -rw-r--r-- 1 root root 1298 Jan 6 01:57 udm-le.env -rwxr-xr-x 1 root root 3299 Jan 6 01:50 udm-le.sh
Any suggestions?