alxwolf / ubios-cert

Manage SSL / TLS certificates with acme.sh (Let's Encrypt, ZeroSSL) for Ubiquiti UbiOS firmwares
MIT License
170 stars 20 forks source link

Fix #26: Check for the presence of /etc/init.d/crond or /etc/init.d/cron instead of relying on $IS_UNIFI_2 #27

Closed ndbroadbent closed 1 year ago

ndbroadbent commented 1 year ago

This fixes the crash I experienced when running the script on my UDM. Instead of checking the output of ubnt-device-info model, just check for /etc/init.d/crond or /etc/init.d/cron

# ubnt-device-info model
UniFi Dream Machine

# ubnt-device-info summary
Device information summary:
        Subsystem ID: ea11
              Family: UniFi Dream Machine (UDM)
               Model: UniFi Dream Machine (UDM)
 Default MAC address: **:**:**:**:**:**
Default IPv4 address: 127.0.0.1
            Firmware: 1.12.30 (1.12.30)
alxwolf commented 1 year ago

Thanks @ndbroadbent, cannot verify for V2.0 (don't have the HW) but looks good and feasible! Merged.