Feature Idea: Generic 'run shell' app with cron support

Dear FBoxers.

Tl;dr: Add a simple app that runs a shell command or script either on-demand or via cron.

I was toying with my FB and a second raspi with a camera module the other day. I was using an FB account to set up a shell script (triggered by cron) that would log into the picam with ssh, take a picture, download it via scp and put it onto an FB share, so I can access the fotos remotely anytime. Worked like a charm, but I was lacking an easy way to trigger fotos on-demand instead of having to wait for the next cron run.

So here’s the idea: What about a generic FB app that runs a shell comand or script, either on demand using a button on the FB UI, or even via cron. The configuration UI for the app would consist of a text box for the shell command/script, a second text field for an optional cron expression and a button to trigger execution right away. Viewing logs would also be nice for trouble shooting (esp. when trying to get paths right with cron).

The generic nature of this new app would allow all kinds of automation around network-related tasks, e. g. for home automation, backups, nightly jobs etc. - all through a nice user interface.

I am aware that I can do all that using the standard mechanisms: ssh into the box, set up a script, configure a crontab etc. But putting it into an app would allow non-tech-savvy users a lower entry barrier for scenarios like the above.

  • What do you think?
  • What did I miss?
  • How would one go about implementing / contributing such an app (I know about the contribution docs)?

Thanks for any feedback and discussion!

Cheers,
Axel

3 Likes

Maybe you can set up a cgi-bin script on the Apache server on FreedomBox which triggers the shell script.

Tip: Use mod_auth_pubtkt in your Apache configuration so that the script can be accessed using FreedomBox SSO. Here’s an example.