unifi-linux-utils icon indicating copy to clipboard operation
unifi-linux-utils copied to clipboard

unifi_ssl_import.sh: "==yes" loop on script execution

Open benmshapiro opened this issue 6 years ago • 5 comments

I am using this script to import a Let's Encrypt signed ssl cert into the Ubiquiti Unifi Controller I have hosted on a server running Ubuntu 16.04.5 LTS. When I execute the script I get an infinite loop of "==yes" printed in my terminal. Any leads on the issue? Have you seen this behavior before?

I have made only these changes to the script: hostname changed from default to FDQN matching the Let's Encrypt Cert UNIFI_HOSTNAME=wifi.herebedragons.com

I commented following three lines for Fedora/RedHat/CentOS UNIFI_DIR=/opt/UniFi JAVA_DIR=${UNIFI_DIR} KEYSTORE=${UNIFI_DIR}/data/keystore

I uncomment following three lines for Debian/Ubuntu UNIFI_DIR=/var/lib/unifi JAVA_DIR=/usr/lib/unifi KEYSTORE=${UNIFI_DIR}/keystore

changed LE_MODE= from "no" to "yes" LE_MODE=yes LE_LIVE_DIR=/etc/letsencrypt/live

Here is my kernel version: uname -a Linux 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Any support the community can provide would be appreciated!

Best, Ben

benmshapiro avatar Feb 06 '19 13:02 benmshapiro

Might try dos2unix

On Wed, Feb 6, 2019 at 7:16 AM Ben Shapiro [email protected] wrote:

I am using this script to import a Let's Encrypt signed ssl cert into the Ubiquiti Unifi Controller I have hosted on a server running Ubuntu 16.04.5 LTS. When I execute the script I get an infinite loop of "==yes" printed in my terminal. Any leads on the issue? Have you seen this behavior before?

I have made only these changes to the script: hostname changed from default to FDQN matching the Let's Encrypt Cert

UNIFI_HOSTNAME=wifi.herebedragons.com I commented following three lines for Fedora/RedHat/CentOS

#UNIFI_DIR=/opt/UniFi #JAVA_DIR=${UNIFI_DIR} #KEYSTORE=${UNIFI_DIR}/data/keystore I uncomment following three lines for Debian/Ubuntu

UNIFI_DIR=/var/lib/unifi JAVA_DIR=/usr/lib/unifi KEYSTORE=${UNIFI_DIR}/keystore changed LE_MODE= from "no" to "yes"

LE_MODE=yes LE_LIVE_DIR=/etc/letsencrypt/live

Here is my kernel version: uname -a Linux 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Any support the community can provide would be appreciated!

Best, Ben

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stevejenkins/unifi-linux-utils/issues/38, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV_lyiuC3vXHvYcSU2WDZTKxmIi6zOrks5vKtWogaJpZM4alNsd .

rjt avatar Feb 06 '19 13:02 rjt

i too have the same problem. is this normal?

rad182 avatar Jun 22 '19 17:06 rad182

I had to change some lines in the script. Think it's easier if you change line 45 to this:

LE_MODE=true

You will see a lot of errors about missing ]], ignore them, works fine.

fredsimard avatar Apr 30 '20 18:04 fredsimard

Also getting a lot of errors regarding missing ]].. tried to fix the if statements without success :/ Anyway, it works and that is the most important part.

tobiasehlert avatar Apr 07 '21 09:04 tobiasehlert

Just for you all and information because I also struggled with the [[ not found error: If you call the script with bash .... then the errors are gone.

admin-ujima avatar Dec 01 '22 12:12 admin-ujima