Skip to content

Can't curl a calendar using script-shell #3

Description

@Cambi0nn

I'm not entirely sure why, but trying to use curl to grab a calendar from a public url doesn't work when running trough script-shell.

  • The script does work correctly when manually ssh'ing into the watch as ceres and run it using /home/ceres/script-shell/03_update-agenda.sh, showing the script itself is fine.
  • script-shell does work correctly for turning on and off the wi-fi, making me believe it's more likely something specific to this scenario than an issue with script-shell not being correctly build or installed.

The contents of 03_update-agenda.sh are as follows. Of course, with redacted links and calendar names.

#!/bin/sh

url1="<URL>"
target1="/home/ceres/script-shell/1.ics"

url2="<URL>"
target2="/home/ceres/script-shell/2.ics"

# download and import calendar 1, overwrite old ones
echo "-> downloading calendar 1"
curl -o ${target1} ${url1} || exit 1

echo "-> importing calendar 1"
icalconverter import /home/ceres/script-shell/priv.ics -d || exit 1

# download and import together calendar 2, add on top
echo "-> downloading calendar 2"
curl -o ${target2} ${url2}  || exit 1

echo "importing work calendar"
icalconverter import /home/ceres/script-shell/work.ics || exit 1

# return success message
echo "-> Successfully imported calendars"
exit 0

It runs until it breaks after this line. As in, I get this echo and then the ERR ending.

# download and import calendar 1, overwrite old ones
echo "-> downloading calendar 1"
curl -o ${target1} ${url1} || exit 1

Seems that when running the script trough script-shell, the curl fails for some reason returning the exit 1. However, I don't know what the difference is between running the script in script-shell (which breaks) and running it as after ssh'ing into the watch as ceres (which works).

Tested on a catfish_ext.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions