mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 19:13:11 +08:00
15 lines
374 B
Bash
15 lines
374 B
Bash
#!/bin/bash
|
|
|
|
BASEPATH=/opt
|
|
INSTALLPATH=$BASEPATH/MQTTnetServer
|
|
|
|
# Check if systemctl exists, does not exist in docker containers
|
|
SCTL=$(which systemctl >/dev/null; echo $?)
|
|
|
|
if [ "$SCTL" -eq "0" ]; then
|
|
# Stop service before uninstalling
|
|
systemctl stop mqttnet-server
|
|
fi
|
|
|
|
# Remove permission to open ports
|
|
setcap CAP_NET_BIND_SERVICE=-eip $INSTALLPATH/MQTTnet.Server |