Working snap user detection.

pull/738/merge
Roger A. Light 8 years ago
parent d982c265cb
commit 55e9e84973

@ -10,12 +10,10 @@
# that mosquitto is being run as a system daemon, and SNAP_COMMON will be used. # that mosquitto is being run as a system daemon, and SNAP_COMMON will be used.
# If a non-root user runs the command, then SNAP_USER_COMMON will be used. # If a non-root user runs the command, then SNAP_USER_COMMON will be used.
if [ "$USER" = "root" ] case "$SNAP_USER_COMMON" in
then */root/snap/mosquitto/common*) COMMON=$SNAP_COMMON ;;
COMMON=$SNAP_COMMON *) COMMON=$SNAP_USER_COMMON ;;
else esac
COMMON=$SNAP_USER_COMMON
fi
CONFIG_FILE="$SNAP/default_config.conf" CONFIG_FILE="$SNAP/default_config.conf"
CUSTOM_CONFIG="$COMMON/mosquitto.conf" CUSTOM_CONFIG="$COMMON/mosquitto.conf"

Loading…
Cancel
Save