Thanks Johan - this looks like it would do the trick. I'll setup up a pull 
request. 

--
web:http://geographika.co.uk
twitter: @geographika


On Wed, Sep 9, 2020, at 9:28 AM, Johan Van de Wauw wrote:
> If you add a script to /etc/profile.d/ it will be sourced to all interactive 
> users.
> I would use the version number, this version number is available while 
> building the image ($VERSION). 
> adding
> echo "export OSGEOLIVE=$VERSION">/etc/profile.d/osgeolive.sh should do the 
> trick.
> 
> On Tue, Sep 8, 2020, 22:26 Seth G <se...@geographika.co.uk> wrote:
>> Hi list,
>> 
>> 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. 
>> 
>> Looking at the current system environment variables I don't think there is 
>> something that would definitively declare a script is running on OSGeoLive. 
>> 
>> Setting an OSGEOLIVE variable to the version could be even more helpful e.g. 
>> "export OSGEOLIVE=14" (somewhere in 
>> https://github.com/OSGeo/OSGeoLive/tree/master/bin - 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 
>> https://github.com/OSGeo/OSGeoLive/blob/master/bin/setup.sh ?
>> 
>> "export OSGEOLIVE=true" or similar could be used if keeping version numbers 
>> updated is a problem. 
>> 
>> Then any demos could be multipurposed - running in cloud plus running on 
>> osgeolive and setting appropriate paths to data if that is the case. 
>> 
>> Seth
>> 
>> --
>> web:http://geographika.co.uk
>> twitter: @geographika
>> _______________________________________________
>> osgeolive mailing list
>> osgeolive@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/osgeolive
_______________________________________________
osgeolive mailing list
osgeolive@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/osgeolive

Reply via email to