Skip to content

Commit

Permalink
Working snap user detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Apr 10, 2018
1 parent d982c26 commit 55e9e84
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions snap/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
# 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 [ "$USER" = "root" ]
then
COMMON=$SNAP_COMMON
else
COMMON=$SNAP_USER_COMMON
fi
case "$SNAP_USER_COMMON" in
*/root/snap/mosquitto/common*) COMMON=$SNAP_COMMON ;;
*) COMMON=$SNAP_USER_COMMON ;;
esac

CONFIG_FILE="$SNAP/default_config.conf"
CUSTOM_CONFIG="$COMMON/mosquitto.conf"
Expand Down

0 comments on commit 55e9e84

Please sign in to comment.