<div dir="ltr"><div dir="auto"><div>If you add a script to /etc/profile.d/ it will be sourced to all interactive users.</div><div>I would use the version number, this version number is available while building the image ($VERSION). </div><div>adding</div><div>echo "export OSGEOLIVE=$VERSION">/etc/profile.d/osgeolive.sh should do the trick.</div><div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 8, 2020, 22:26 Seth G <<a href="mailto:sethg@geographika.co.uk" target="_blank">sethg@geographika.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi list,<br>
<br>
It would be useful for a Python Notebook (or any demo application) to know if it is running on OSGeoLive in order to set paths to data etc. <br>
<br>
Looking at the current system environment variables I don't think there is something that would definitively declare a script is running on OSGeoLive. <br>
<br>
Setting an OSGEOLIVE variable to the version could be even more helpful e.g. "export OSGEOLIVE=14" (somewhere in <a href="https://github.com/OSGeo/OSGeoLive/tree/master/bin" rel="noreferrer noreferrer" target="_blank">https://github.com/OSGeo/OSGeoLive/tree/master/bin</a> - although I'm not sure where). As noted in IRC from kalxas "we can add this to the bash profile of new users" - so maybe in <a href="https://github.com/OSGeo/OSGeoLive/blob/master/bin/setup.sh" rel="noreferrer noreferrer" target="_blank">https://github.com/OSGeo/OSGeoLive/blob/master/bin/setup.sh</a> ?<br>
<br>
"export OSGEOLIVE=true" or similar could be used if keeping version numbers updated is a problem. <br>
<br>
Then any demos could be multipurposed - running in cloud plus running on osgeolive and setting appropriate paths to data if that is the case. <br>
<br>
Seth<br>
<br>
--<br>
web:<a href="http://geographika.co.uk" rel="noreferrer noreferrer" target="_blank">http://geographika.co.uk</a><br>
twitter: @geographika<br>
_______________________________________________<br>
osgeolive mailing list<br>
<a href="mailto:osgeolive@lists.osgeo.org" rel="noreferrer" target="_blank">osgeolive@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/osgeolive" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/osgeolive</a><br>
</blockquote></div></div></div>
</div>