Scripting

From VyOS Wiki
Jump to: navigation, search

Scripting

VyOS supports executing configuration and operational commands non-interactively from shell scripts:

postconfig

The /config/scripts/vyatta-postconfig-bootup.scriptscript is called on boot after the VyOS configuration is fully applied.

Any modifications done to work around unfixed bugs and implement enhancements which are not complete in the VyOS system can be placed here.

In this example, the script performs igmp configuration that cannot be done through the CLI yet.

#!/bin/sh
echo 0 > /sys/devices/virtual/net/br1/bridge/multicast_snooping
echo 0 > /sys/devices/virtual/net/br1/bridge/multicast_querier
echo 0 > /sys/devices/virtual/net/br1/bridge/multicast_router

For configuration/upgrade management issues, modification of this script should be the last option. Always try to find solutions based on CLI commands first.