Last active
August 15, 2021 09:55
-
-
Save vilhelmen/95fddc211408d75679563736358baba0 to your computer and use it in GitHub Desktop.
Pfsense unifi installer stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ABI=`/usr/sbin/pkg config abi` | |
# Modify /usr/local/etc/pkg/repos/pfSense.conf to include FreeBSD data: | |
# FreeBSD: { | |
# url: "pkg+https://pkg.freebsd.org/${ABI}/latest", | |
# mirror_type: "srv", | |
# signature_type: "fingerprints", | |
# fingerprints: "/usr/share/keys/pkg/", | |
# enabled: no | |
# } | |
# For best safety, extract current config, delete, add, work, restore? | |
# Ugh just copy it over to /tmp and assume the default config | |
cp /usr/local/etc/pkg/repos/pfSense.conf /tmp/pfSense.conf | |
fgrep -v 'FreeBSD: { enabled: no }' /tmp/pfSense.conf > /usr/local/etc/pkg/repos/pfSense.conf | |
cat << EOF >> /usr/local/etc/pkg/repos/pfSense.conf | |
FreeBSD: { | |
url: "pkg+https://pkg.freebsd.org/${ABI}/latest", | |
mirror_type: "srv", | |
signature_type: "fingerprints", | |
fingerprints: "/usr/share/keys/pkg/", | |
enabled: yes | |
} | |
EOF | |
# pkg wants to update, please don't | |
pkg lock pkg | |
# maybe just yes | pkg lock -a | |
pkg install unifi6 | |
# RESTORE PACKAGE LOCK | |
# yes | pkg unlock -a | |
# Unecessary icu lock if unifi locked? | |
# boost/mongo lock does NOT lock icu, so yes. | |
pkg unlock pkg | |
# This does not seem needed at or around 2.4.5-p1 | |
pkg lock icu | |
# Restore package conf | |
cp /tmp/pfSense.conf /usr/local/etc/pkg/repos/pfSense.conf | |
# fix java launch | |
# look into integrating boot speedup fix in the custom launcher | |
sed -i.bak -e 's|com.ubnt.ace.Launcher|-jar /usr/local/share/java/unifi/lib/ace.jar|g' /usr/local/etc/rc.d/unifi | |
rm /usr/local/etc/rc.d/unifi.bak | |
mv /usr/local/etc/rc.d/unifi /usr/local/etc/rc.d/unifi.sh | |
if [ ! -f /etc/rc.conf.local ] || [ $(grep -c unifi_enable /etc/rc.conf.local) -eq 0 ]; then | |
echo -n "Enabling the unifi service..." | |
echo "unifi_enable=YES" >> /etc/rc.conf.local | |
echo " done." | |
fi | |
service unifi.sh start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repo enabling should be changed to toggling the enabled status in
/usr/local/etc/pkg/repos/pfSense.conf
. Attempting to upgrade pfsense without a fresh install and restore.LMAO, pfsense updater marks it and its dependencies to be uninstalled, cool. Thanks for that.
No longer boots. Why is this always so difficult. Starting fresh.
Still doesn't work. Netgate didn't test 2.5.x on the hardware they sold me. At least it's not my fault