Merge pull request #2 from asymetrixs/deb-packaging

Docker support
This commit is contained in:
Damian
2021-03-12 14:41:38 +01:00
committed by GitHub
3 changed files with 26 additions and 11 deletions
+5
View File
@@ -30,5 +30,10 @@ setcap CAP_NET_BIND_SERVICE=+eip $INSTALLPATH/MQTTnet.Server
chmod 644 /etc/systemd/system/mqttnet-server.service chmod 644 /etc/systemd/system/mqttnet-server.service
# Check if systemctl exists, does not exist in docker containers
SCTL=$(which systemctl >/dev/null; echo $?)
if [ "$SCTL" -eq "0" ]; then
# Reload systemd because of new service file # Reload systemd because of new service file
systemctl daemon-reload systemctl daemon-reload
fi
+6 -1
View File
@@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
# Reload systemd because of absent service file # Check if systemctl exists, does not exist in docker containers
SCTL=$(which systemctl >/dev/null; echo $?)
if [ "$SCTL" -eq "0" ]; then
# Reload systemd because of new service file
systemctl daemon-reload systemctl daemon-reload
fi
+5
View File
@@ -3,8 +3,13 @@
BASEPATH=/opt BASEPATH=/opt
INSTALLPATH=$BASEPATH/MQTTnetServer 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 # Stop service before uninstalling
systemctl stop mqttnet-server systemctl stop mqttnet-server
fi
# Remove permission to open ports # Remove permission to open ports
setcap CAP_NET_BIND_SERVICE=-eip $INSTALLPATH/MQTTnet.Server setcap CAP_NET_BIND_SERVICE=-eip $INSTALLPATH/MQTTnet.Server