Files
bsd-apps/meshcentral/meshcentral-install.sh

37 lines
1.1 KiB
Bash
Raw Normal View History

2024-09-13 07:25:13 -06:00
#!/bin/sh
# Install MeshCentral
2024-09-13 11:58:22 -06:00
NODE_VERSION="20"
2024-09-13 07:25:13 -06:00
# Check for root privileges
if ! [ $(id -u) = 0 ]; then
echo "This script must be run with root privileges"
exit 1
fi
2024-09-13 11:58:22 -06:00
# Install packages
pkg install -y npm-node"${NODE_VERSION}" node"${NODE_VERSION}"
2024-09-13 07:25:13 -06:00
# Create directories
mkdir -p /usr/local/meshcentral/meshcentral-data
mkdir -p /usr/local/meshcentral/meshcentral-files
mkdir -p /usr/local/meshcentral/meshcentral-backups
mkdir -p /usr/local/etc/rc.d
mkdir -p /var/run/meshcentral
# Install MeshCentral
pw user add meshcentral -c meshcentral -u 6374 -s /usr/sbin/nologin -d /home/meshcentral -m
cd /usr/local/meshcentral && npm install meshcentral
chown -R meshcentral:meshcentral /usr/local/meshcentral
chown -R meshcentral:meshcentral /var/run/meshcentral
2024-09-13 11:53:54 -06:00
fetch -o /usr/local/etc/rc.d/ https://raw.githubusercontent.com/tschettervictor/bsd-apps/main/meshcentral/usr/local/etc/rc.d/meshcentral
2024-09-13 07:25:13 -06:00
# Enable and start services
sysrc meshcentral_enable="YES"
service meshcentral start && sleep 5
echo "---------------"
echo "Installation complete."
2024-09-13 11:53:54 -06:00
echo "MeshCentral is running on port 1025"
2024-09-13 07:25:13 -06:00
echo "---------------"