diff options
author | Rémy Oudompheng <remy@archlinux.org> | 2011-07-14 16:07:25 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-07-14 16:07:25 +0200 |
commit | be77b6956ed852aedd79c58a0c94944aa6832839 (patch) | |
tree | 88327e215cd7157180260f0ad7f98b5fdec933f7 /src | |
parent | c8bcc10c322cb281ab3abb78483eebf189aeede4 (diff) | |
parent | e6b95df3a80a92480a5ee062a13f5c844802098a (diff) | |
download | netctl-be77b6956ed852aedd79c58a0c94944aa6832839.tar.gz netctl-be77b6956ed852aedd79c58a0c94944aa6832839.tar.xz |
Merge remote-tracking branch 'kylef/tunnel'
Diffstat (limited to 'src')
-rw-r--r-- | src/connections/tunnel | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/connections/tunnel b/src/connections/tunnel new file mode 100644 index 0000000..613cc67 --- /dev/null +++ b/src/connections/tunnel @@ -0,0 +1,41 @@ +#! /bin/bash +. /usr/lib/network/network + +tunnel_up() { + load_profile "$1" + + if [ -e "/sys/class/net/$INTERFACE" ]; then + report_fail "Interface $INTERFACE already exists." + exit 1 + else + ip tunnel add "$INTERFACE" mode "$MODE" remote "$REMOTE" + fi + + if [[ -n "$LOCAL" ]]; then + ip tunnel change "$INTERFACE" local "$LOCAL" + fi + + bring_interface up "$INTERFACE" + + "$CONN_DIR/ethernet" up "$1" + return 0 +} + +tunnel_down() { + load_profile "$1" + + "$CONN_DIR/ethernet" down "$1" + bring_interface down "$INTERFACE" + ip tunnel del "$INTERFACE" + + return 0 +} + +tunnel_status() { + true +} + +tunnel_$1 "$2" +exit $? + +# vim: set ts=4 et sw=4: |