
unset RUN_GNC

if [ -e /var/lib/groovix/net-control/force-on-startup ] ; then
	RUN_GNC=true
	rm /var/lib/groovix/net-control/force-on-startup
fi

if [ "$(cat /var/lib/groovix/shutdown-action.last)" != "reboot" ] ||  [ "$GNC_RUN_AFTER_REBOOT"  = "true" ] ; then
	RUN_GNC=true
fi

if [ "$RUN_GNC" = "true" ] ; then
	groovix-net-control --from=startup
else
	echo "not running gncs because we are rebooting and GNC_RUN_AFTER_REBOOT is not true and /var/lib/groovix/need-to-run-gnc does not exist"
	groovix-net-control --from=startup --dont-run
fi
