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

Permissions not set on keystore #30

Open phoenixv opened 5 years ago

phoenixv commented 5 years ago

Some installations run the controller as a dedicated user, ubnt in many cases. The script does not check for permissions and can render the controller unusable as the keystore cannot be loaded. The simple hardcoded solution was adding two variables:

UBNT_USER=ubnt UBNT_GROUP=ubnt

And this addition before the controller is restarted.

Fix permissions

chown ${UBNT_USER}.${UBNT_GROUP} ${KEYSTORE}

Storing the existing permissions during the backup process may be cleaner, but since this variables must be modified before use anyway this method is sufficient.