2020-08-19 08:46:04 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Based on alpine's tunnel 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
|
|
|
|
|
|
|
|
case "$PHASE" in
|
|
|
|
pre-up)
|
2020-08-19 09:13:56 +00:00
|
|
|
${MOCK} eval ip tunnel add $IFACE $PARAMS
|
2020-08-19 08:46:04 +00:00
|
|
|
;;
|
|
|
|
post-down)
|
2020-08-19 09:13:56 +00:00
|
|
|
${MOCK} ip tunnel del $IFACE
|
2020-08-19 08:46:04 +00:00
|
|
|
;;
|
|
|
|
depend)
|
|
|
|
echo "$IF_TUNNEL_DEV"
|
|
|
|
;;
|
|
|
|
esac
|