description "Indicator Network Backend"

start on indicator-services-start
stop on desktop-end or indicator-services-end

env G_MESSAGES_DEBUG=all
export G_MESSAGES_DEBUG

respawn
respawn limit 2 10

pre-start script
	# NOTE: Only used on Unity8 today, not 7
	#       Still allows manual starting
	if [ "x$DESKTOP_SESSION" != "xubuntu-touch" ] && 
	   [ "x$DESKTOP_SESSION" != "xunity8" ]; then
		if [ "x$UPSTART_EVENTS" != "x" ] ; then
			stop; exit 0
		fi
	fi
end script

exec $SNAP/usr/lib/indicator-network/indicator-network-service
