10934 questions

13039 answers

20335 comments

27479 members

0 votes
147 views 1 comments
by
I have a simple script that I want to run every minute as a cron job.

How can I package it so that I can send it to other people to install? I don't want to have to talk them through scp/ssh to transfer the script and set it up, and even if I set it up for them I still want to be able to send them updates to it if needed.

Can I create a simple package containing it that could be uploaded via the package manager? Is there a better way?

Related question: Where is the "correct" place to store a script on the filesystem?

TRB140/141 if that matters.

1 Answer

0 votes
by

Hello,

No, you cannot create Package Manager packets, which your device would accept. "Services -> Package Manager" functionality is only mean to allow install official Teltonika packages.

The proper way to transfer your script to the router is either through SCP protocol as a file, or through SSH as a plain text (by creating new file on the router and copy-pasting its text over SSH). I seems that you are familiar with both of these approaches already.

If you want to simplify this process and make it easier to upload or update your script in the future, you could either make changes to your script, so that it would attempt to connect to your servers and update itself remotely, or you could implement any third party "package manager" alternative, which are meant to share generic files/packages.

Additionally, take note that you can compile your own custom firmware, with your script already built in the firmware. If update would ever be needed, you would be able to simply compile new device's firmware with new version of your script. SDK and its brief instructions can be found here:

https://wiki.teltonika-networks.com/view/Software_Development_Kit

https://wiki.teltonika-networks.com/view/RUT_Software_Development_Kit_instructions

Meanwhile, it does not matter where you would place your own script files on the router (that should not interfere with the device). You can place your script in /bin or /usr/bin directories, since these directories already have prebuilt binaries.

Best answer
by

OK, thanks.

In that case I think my best option is to tell the other user to log into the terminal via the web browser, and run something like:

wget https://<mysite>/path/to/install.sh -O- | sh

Just need to write that script now!