You are viewing an article about an obsolete product. Information on this page is provided as-is and not supported.

How to Upload and run python scripts in TransPort routers

 

1) Upload the script on the TransPort via WEB GUI


In the WEB GUI, browse to Administration-File management > File editor, click in the Filename field (where there is "--edit--"):

User-added image

Type a name for the script (for TestPy.py). Then, in the blank window below, paste the script content. Then click on Save File and then you should see: 
 
User-added image

2) Upload the script on the TransPort via FTP


Another method to load the python script into the TransPort is to use the FTP. Write the script into a file (a Python script is a text file containing python commands and may be created using a normal plain text editor) and give a name to it (as TestPy.py). Then open an FTP client as Filezilla, connect to the Transport IP with the username and password you use to access the WEB GUI.
 
Once connected, transfer the TestPy.py file to the TranSport, at the end of the transfer, you should see the file in the TransPort directory:
 
User-added image
 

3) Run and auto-run the script

In order to have the script running , go in the Administration – Execute command section of the WEB GUI (or in the command line) and type:
 
python TestPy.py
 
User-added image
 
It is also possible to make the script running also if the device reboots, going in the WEB GUI to Configuration - system > General, then in the autorun command section type the command 
 
python TestPy.py
 
and click Add:

User-added image

 
You should then see that the command is added:

User-added image

and click apply.
 

4) Check that the Python script is running

 
It is always possible to check which python script are running by issuing the following command:
 
pycfg scripts
 
In this case, the output of the command is the following:
 
User-added image

Last updated: Mar 05, 2019

Recently Viewed

No recently viewed articles

Did you find this article helpful?