You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
516 B

  1. #!/bin/bash
  2. BASEPATH=/opt
  3. INSTALLPATH=$BASEPATH/MQTTnetServer
  4. # Check if systemctl exists, does not exist in docker containers
  5. SCTL=$(which systemctl >/dev/null; echo $?)
  6. if [ "$SCTL" -eq "0" ]; then
  7. # Stop service before uninstalling
  8. systemctl stop mqttnet-server
  9. fi
  10. # Check if setcap exists, does not exist in docker containers
  11. SCAP=$(which setcap >/dev/null; echo $?)
  12. if [ "$SCAP" -eq "0" ]; then
  13. # Remove permission to open ports
  14. setcap CAP_NET_BIND_SERVICE=-eip $INSTALLPATH/MQTTnet.Server
  15. fi