Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - BrandonG777

#1
So despite a UPS and other measures I've taken to ensure my OPNsense box never loses power abruptly I still end up unplugging a wrong cord or a battery fails or whatever and the Unifi Controller mongodb seems to instantly corrupt. Maybe there is a way of fixing this but restoring from an automated backup has been the only method I have attempted. Anyway, here is the script I wrote that will fix the corrupted database quick.

#!/usr/local/bin/bash
service unifi stop
pkg remove -y unifi6
mv /usr/local/share/java/unifi /usr/local/share/java/unifi.bad
pkg install -y unifi6 os-unifi-maxit
cp -pRv /usr/local/share/java/unifi.bad/data/backup /usr/local/share/java/unifi/data/backup
service unifi start
rm -rf /usr/local/share/java/unifi.bad
ipaddr=$(ifconfig em1 | grep 'inet' | awk '$1 == "inet" { print $2 }')         
echo "Now to go https://$ipaddr:8443 and restore your backup."
read -p "Press enter to continue" continue
service unifi start


I place this in a file called /root/unifi-fix.sh then make it executable "chmod +x unifi-fix.sh" and then execute it ./unifi-fix.sh
#2
I'm unable to get OPNsense to check for updates because DNS is failing.

/etc/resolv.conf has an incorrect nameserver (10.13.13.1) that I cannot ping and also says it's generated by resolvconf

I can modify my DNS settings through System->Settings->General but when I reboot it reverts back to the incorrect configuration.

Also running, Unifi controller through 3rd party repo, wondering if this isn't the cause?