Page MenuHomeDevCentral

routes.sh
No OneTemporary

routes.sh

#!/bin/sh
# -------------------------------------------------------------
# Network — routes configuration for Linux systems
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# Source file: roles/core/network/files/Linux/routes.sh
# Dependencies: iproute
# GNU xargs for -r
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
ROUTES_CONFIG_PATH=/etc/routes.conf
# Runs as root only
test -z $UID && UID=$(id -u)
if [ "$UID" -ne 0 ]; then
echo This script must be run as root. >&2
exit 1
fi
# Warn about configuration missing
if [ ! -f $ROUTES_CONFIG_PATH ]; then
echo No routes configuration file found at $ROUTES_CONFIG_PATH >&2
exit 2
fi
# Apply routes
# Ignore comments and blank line, pass the remaining lines to `ip route`
grep '^[^#]' $ROUTES_CONFIG_PATH | xargs -L 1 -r ip route replace

File Metadata

Mime Type
text/x-shellscript
Expires
Sat, Nov 7, 04:58 (18 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3942713
Default Alt Text
routes.sh (1 KB)

Event Timeline