Running a Terminal Script through Indigo

Posted on
Mon Aug 10, 2020 12:52 pm
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Running a Terminal Script through Indigo

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.

Posted on
Mon Aug 10, 2020 3:20 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Running a Terminal Script through Indigo

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).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Aug 10, 2020 3:32 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Running a Terminal Script through Indigo

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

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests