mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-26 12:45:20 +03:00
27 lines
428 B
Bash
27 lines
428 B
Bash
#!/bin/sh
|
|
|
|
# Static routing configuration script
|
|
# Copyright (c) 2016-2020 Kaarle Ritvanen
|
|
|
|
if [ $MODE = start ]; then
|
|
ACTION=add
|
|
elif [ $MODE = stop ]; then
|
|
ACTION=del
|
|
else
|
|
exit 1
|
|
fi
|
|
|
|
configure() {
|
|
local class=$1
|
|
shift
|
|
|
|
local entry
|
|
IFS=,
|
|
for entry in $(eval "echo \"\$IF_$(echo $class | tr a-z A-Z)\""); do
|
|
IFS=" "
|
|
ip $class $ACTION $entry $*
|
|
done
|
|
}
|
|
|
|
configure route src ${IF_ADDRESS%/*} dev $IFACE
|
|
configure rule
|