install.fairie/scripts/partials/pfsense
Brian Zalewski ad7291db25 Latest
2023-07-18 06:35:49 +00:00

45 lines
1.3 KiB
Text

### Enable FreeBSD package repo
logg info 'Enabling FreeBSD package repo'
FILE_PATH="/usr/local/etc/pkg/repos/pfSense.conf"
TMP_FILE=$(mktemp)
REPLACEMENT="FreeBSD: { enabled: yes }"
echo "$REPLACEMENT" > "$TMP_FILE"
tail -n +2 "$FILE_PATH" >> "$TMP_FILE"
mv -f "$TMP_FILE" "$FILE_PATH"
rm -f "$TMP_FILE"
### Install Netdata / dependencies
logg info 'Installing Netdata system package dependencies'
pkg update
pkg install -y curl pkgconf bash e2fsprogs-libuuid libuv nano
pkg install -y json-c-0.15_1
pkg install -y py39-certifi-2023.5.7
pkg install -y py39-asn1crypto
pkg install -y py39-pycparser
pkg install -y py39-cffi
pkg install -y py39-six
pkg install -y py39-cryptography
pkg install -y py39-idna
pkg install -y py39-openssl
pkg install -y py39-pysocks
pkg install -y py39-urllib3
pkg install -y py39-yaml
pkg install -y netdata
### Modify Netdata configuration
logg info 'Configuring Netdata to work with Netdata Cloud'
# TODO: Add below to netdata.conf
# bind to = 127.0.0.1 to bind to = 0.0.0.0
NETDATA_CLOUD_API_TOKEN="YOUR_API_TOKEN_HERE"
cat <<EOF > /usr/local/etc/netdata/netdata.conf
[backend]
enabled = yes
data source = netdata
destination = https://app.netdata.cloud
api key = ${NETDATA_CLOUD_API_TOKEN}
EOF
### Start Netdata
logg info 'Starting Netdata service'
service netdata onestart