User Scripts examples

From Teltonika Networks Wiki

Introduction

User Scripts is a service in RUT routers that provides the user with the possibility to create custom shell scripts that run at the end of router's boot process.

This article will provide some examples on the usage of User Scripts. Although it must be noted that one should be at least be partially familiar with the syntax and basic principles of shell scripts beforehand as this guide will not provide a tutorial on shell scripts themselves.

Example 1: 1-Wire Data to Server via HTTP

Since there is no Web interface support for getting 1-wire data, it has to be accessed via SSH or Console modes. As of now, the Data to Server function for 1-wire sensor data can only be done by writing a custom script since there are no direct methods of storing this data.


This article will provide a step-by-step configuration on how to configure data to server using a custom script that allows 1-wire data to be sent on an HTTP server.



Connect to the TRB141 CLI via SSH or WebUI.

Create a new directory for you to save the script that is to be created later. (Optional)

Navigate to it, then create a new sh file using the “vi” command followed by the filename of your choice. (Don’t forget to add the .sh extension at the end).












Example 2: filtering SMS messages