Page 1 of 1

Running a Terminal Script through Indigo

PostPosted: Mon Aug 10, 2020 12:52 pm
by stanleykrasnow
I an trying to run a Terminal Script that calls a compiled Pytho(?) modlule that updates an SQLite DB containing exercise data from my Garmin watch. The shell script I have works when I drag and drop it into a termnal window. When I run the script through Indigo I get:
Code: Select all
   Aug 10, 2020 at 2:24:00 PM
      Schedule                        Draft II - Nightly Garmin Database Update
      Action Collection Error         Run Shell Script action: script /Users/stanleykrasnow/Desktop/GarminDB/GarminDb_Darwin_1.7.0/download_update_dbs.sh exited abnormally with a return code of: 126

The system condole shows:

Code: Select all
   Aug 10 14:24:01 Stanley-Krasnows-Mac-mini IndigoServer[593]: Action Collection Error   Run Shell Script action: script /
  Users/stanleykrasnow/Desktop/GarminDB/GarminDb_Darwin_1.7.0/download_update_dbs.sh exited abnormally with a return code of: 126

The script I'm trying to run is:
Code: Select all
   #!/bin/sh
   # Use this script to update existing DBs by downloading daily monitoring and activity files from Garmin Connect (https://connect.garmin.com)
   echo "Updating existing DBs by downloading from Garmin Connect"
   # cd /Users/stanleykrasnow/Desktop/GarminDB/GarminDb_Darwin_1.7.0
   # ./garmin --all --download --import --analyze --latest
   # ./garmin --activities --download
   cd /Users/stanleykrasnow/Desktop/GarminDB/GarminDb_Darwin_1.7.0 ; ./garmin --all --download --import --analyze --latest

Can someone please help me understand what is happening? Thank you.

Re: Running a Terminal Script through Indigo

PostPosted: Mon Aug 10, 2020 3:20 pm
by jay (support)
Yeah, that script won't run because it's assuming that it is running directly in an interactive shell.

Check out the Python documentation for the subprocess module. It has an option to run a script in a shell that I believe will work (though not positive).

Re: Running a Terminal Script through Indigo

PostPosted: Mon Aug 10, 2020 3:32 pm
by jay (support)
You could try running the command directly from individual Run Shell Script:

Code: Select all
/Users/stanleykrasnow/Desktop/GarminDB/GarminDb_Darwin_1.7.0/garmin  --all --download --import --analyze --latest