mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
Ajout de omr-6in4-run
This commit is contained in:
parent
4b47717168
commit
e5976b3f61
1 changed files with 22 additions and 0 deletions
22
omr-6in4-run
Executable file
22
omr-6in4-run
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ ! -f "$2" ]; then
|
||||||
|
echo "usage: $(basename "$0") FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "$(readlink -f "$2")"
|
||||||
|
|
||||||
|
DEV="omr-6in4-$(basename "$2")"
|
||||||
|
|
||||||
|
if [ "$1" = "start" ]; then
|
||||||
|
[ -n "$(ip tunnel show ${DEV})" ] && ip tunnel del ${DEV} 2>&1 >/dev/null
|
||||||
|
ip tunnel add ${DEV} mode sit remote ${REMOTEIP} local ${LOCALIP}
|
||||||
|
ip -6 addr add ${LOCALIP6} dev ${DEV}
|
||||||
|
ip link set ${DEV} up
|
||||||
|
fi
|
||||||
|
if [ "$1" = "stop" ]; then
|
||||||
|
ip tunnel del ${DEV}
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue