diff --git a/mcsetup_cs9.sh b/mcsetup_cs9.sh new file mode 100644 index 0000000..2a891aa --- /dev/null +++ b/mcsetup_cs9.sh @@ -0,0 +1,43 @@ +sudo dnf -y update +sudo dnf -y in nano nodejs npm mongodb +systemctl enable --now mongodb + +sudo useradd -m -r -d /home/meshcentral -s /sbin/nologin meshcentral + +# +# +cat < /etc/systemd/system/meshcentral.service +[Unit] +Description=MeshCentral Server + +[Service] +Type=simple +LimitNOFILE=1000000 +ExecStart=/usr/bin/node /home/meshcentral/node_modules/meshcentral +WorkingDirectory=/home/meshcentral +Environment=NODE_ENV=production +User=default +Group=default +Restart=always +# Restart service after 10 seconds if node service crashes +RestartSec=10 +# Set port permissions capability +#AmbientCapabilities=cap_net_bind_service + +[Install] +WantedBy=multi-user.target +EOF +# +# + + +cd /home/meshcentral +sudo npm install meshcentral +read -n1 -r -p "Press any key to continue..." +nano meshcentral-data/config.json +echo "ctrl+c to continue after testing..." +sudo -u meshcentral node ./node_modules/meshcentral + + +sudo systemctl daemon-reload +sudo systemctl enable --now meshcentral.service \ No newline at end of file