stevejenkins / unifi-linux-utils

Helpful Linux / Unix scripts for admins of Ubiquiti (UBNT) UniFi wireless products
https://www.stevejenkins.com/blog/tag/unifi/
MIT License
695 stars 127 forks source link

unifi_ssl_import.sh : remove dependency on Ubuntu's service script #44

Open VMFnet opened 4 years ago

VMFnet commented 4 years ago

unifi_ssl_import.sh depends on Ubuntu's service script, which is not available on Debian :

unifi_ssl_import.sh: line 102: service: command not found

Using the standard systemd command instead of service solves the issue.

To make unifi_ssl_import.sh work with vanilla Debian, I had to make the following changes :

Line 102 : /bin/systemctl stop "${UNIFI_SERVICE}"

Line 163 : /bin/systemctl start "${UNIFI_SERVICE}"

A better option would certainly be wrapping these lines in a variable depending on the operating system and returning the correct systemd/service command.