Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Sometimes, it is necessary to perform specific actions on the device startup that may not be specified in the configuration file settings. For this purpose, VP series allows you to set the user-defined script in the configuration file. This script may feature any desired sequence of commands.

For user-defined script execution, use the following settings section in the configuration file:

UserScript:

Enable: "0"

URL: ""

'Enable' option allows (if the value is 1) or denies (if the value is 0) execution of the script which path is specified in the URL parameter.

Executed script may be located on the remote server or on the device itself. The script may be downloaded from the remote server via HTTP or TFTP. Consider configuration file examples for user-defined script execution from various sources.

  1. Execution from HTTP server

    To execute the script from HTTP server, you should specify full path to file in HTTP-URL format within URL parameter:

    URL: “http://192.168.0.250/user-script/script.sh” 

    After the device startup, script.sh file located in the 'user-script' folder at 192.168.0.250 will be downloaded automatically via HTTP from the server and executed afterwards. 

  2. Execution from TFTP server

    To execute the script from TFTP server, you should specify full path to file in TFTP-URL format within URL parameter:

    URL: “tftp://192.168.0.250/user-script/script.sh

    After the device startup, script.sh file located in the 'user-script' folder at 192.168.0.250 will be downloaded automatically via TFTP from the server and executed afterwards.

  3. Local script execution 

    Due to file system specifics, local script should be located in the /etc/config folder only, as the contents of this folder are the only one that remains after the device reboot. Script in /etc/config folder may be created either with vi editor or downloaded from the external TFTP server (using 'tftp –gluser.sh<TFTP-server address>' command). After creation of the script, you should set execution permissions with 'chmod 777 /etc/config/user.sh' command.

    In the configuration file, local script execution URL should be as follows:

    URL: “File://etc/config/user.sh

The user script should begin with the '#!/bin/sh' directive.

  • Нет меток