|
|
@@ -9,12 +9,12 @@ INSTALLPATH=$BASEPATH/MQTTnetServer |
|
|
|
|
|
|
|
# If user does not exist, create it |
|
|
|
if (( $USEREXISTS == 1 )); then |
|
|
|
useradd -d $INSTALLPATH -r $USER |
|
|
|
EC=$(echo $?) |
|
|
|
useradd -d $INSTALLPATH -r $USER |
|
|
|
EC=$(echo $?) |
|
|
|
|
|
|
|
if (( $EC == 1 )); then |
|
|
|
exit 1; |
|
|
|
fi |
|
|
|
if (( $EC == 1 )); then |
|
|
|
exit 1; |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
# Set permissions on files |
|
|
@@ -30,5 +30,10 @@ setcap CAP_NET_BIND_SERVICE=+eip $INSTALLPATH/MQTTnet.Server |
|
|
|
|
|
|
|
chmod 644 /etc/systemd/system/mqttnet-server.service |
|
|
|
|
|
|
|
# Reload systemd because of new service file |
|
|
|
systemctl daemon-reload |
|
|
|
# Check if systemctl exists, does not exist in docker containers |
|
|
|
SCTL=$(which systemct1l >/dev/null; echo $?) |
|
|
|
|
|
|
|
if [ "$SCTL" -eq "0" ]; then |
|
|
|
# Reload systemd because of new service file |
|
|
|
systemctl daemon-reload |
|
|
|
fi |