mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-31 19:31:10 +02:00
27 lines
399 B
Bash
27 lines
399 B
Bash
#!/bin/sh
|
|
|
|
# Tunnel interface configuration script
|
|
# Copyright (c) 2017 Kaarle Ritvanen
|
|
|
|
PARAMS=$(set | sed -E '
|
|
s/^IF_TUNNEL_([A-Z0-9_]+)=(.+)/\1\n\2/
|
|
ta
|
|
d
|
|
:a
|
|
h
|
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
|
P
|
|
g
|
|
s/.*\n//
|
|
')
|
|
|
|
[ "$PARAMS" ] || exit 0
|
|
|
|
if [ $MODE = start ]; then
|
|
eval ip tunnel add $IFACE $PARAMS
|
|
elif [ $MODE = stop ]; then
|
|
ip tunnel del $IFACE
|
|
else
|
|
exit 1
|
|
fi
|