rffit: Add ST_SITES_TXT environment variable

master
Fabian P. Schmidt 2023-01-14 12:18:18 +01:00 committed by Cees Bassa
parent d3d5d11327
commit 6232951052
2 changed files with 14 additions and 6 deletions

View File

@ -16,10 +16,11 @@ Install
Configure
---------
* You will need to set the following environment variables in your login file to run **strf**.
* `ST_DATADIR` path to **strf** directory (e.g. `$HOME/software/strf`)
* `ST_DATADIR` path to **strf** directory (e.g. `$HOME/software/strf`, default: './')
* `ST_TLEDIR` path to TLE directory (e.g. `$HOME/tle`)
* `ST_COSPAR` COSPAR site number (add to site location to `$ST_DATADIR/data/sites.txt`)
* `ST_LOGIN` space-track.org login info (of the form `ST_LOGIN="identity=username&password=password"`)
* `ST_SITES_TXT` path to sites.txt (optional, default: `$ST_DATADIR/data/sites.txt`)
* Run `tleupdate` to download latest TLEs.
* You should install NTP support on the system and configure time/date to automatically
synchronize to time servers.

View File

@ -16,12 +16,19 @@ site_t get_site(int site_id) {
float alt;
char abbrev[3],observer[64];
site_t s;
char *env,filename[LIM];
char *env_datadir,*env_sites_txt,filename[LIM];
env=getenv("ST_DATADIR");
if(env==NULL||strlen(env)==0)
env=".";
sprintf(filename,"%s/data/sites.txt",env);
env_datadir = getenv("ST_DATADIR");
if (env_datadir == NULL || strlen(env_datadir) == 0) {
env_datadir = ".";
}
env_sites_txt = getenv("ST_SITES_TXT");
if (env_sites_txt == NULL || strlen(env_sites_txt) == 0) {
sprintf(filename, "%s/data/sites.txt", env_datadir);
} else {
sprintf(filename, "%s", env_datadir);
}
file=fopen(filename,"r");
if (file==NULL) {