X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sbin%2Fgrml-addtun;h=109cc6ff9180a273e282f677b92ebbf5a46c30d8;hb=a9e6e3a985c3d5103a6dd2d0b435b9a018090a32;hp=765b53abc12c98e148762df9eb2bffe1c46e17eb;hpb=7aa92391c54c8c2da24cf2da64cccf6c6eeb205a;p=grml-network.git diff --git a/sbin/grml-addtun b/sbin/grml-addtun index 765b53a..109cc6f 100755 --- a/sbin/grml-addtun +++ b/sbin/grml-addtun @@ -25,13 +25,13 @@ Usage: "$PN_" [OPTIONS] ... $PN_ creates persistent tun/tap devices with bridge handling OPTIONS: - -d delete the given tun devices and remove them from the bridge if given - -u this user should be able to use the tun device - -g this group should be able to use the tun device - -b if given, all tun/tap devices are added/removed from the bridge - -a enable auto mode, eg. create the bridge if not allready existing and - delete it when empty after removing given tun devices - -h this help + -d delete the tun devices and remove them from the bridge if given + -u this user should be able to use the tun device + -g this group should be able to use the tun device + -b if given, all tun/tap devices are added/removed from the bridge + -a enable auto mode, eg. create the bridge if not already existing and + delete it when empty after removing given tun devices + -h this help EOT } @@ -58,12 +58,12 @@ function createTun() if [[ $OPT_BRIDGE_ != '' ]]; then brctl addif "$OPT_BRIDGE_" "$1" fi - ifconfig "$1" 0.0.0.0 up + ip link set up dev "$1" } function trashTun() { - ifconfig "$1" down + ip link set down dev "$1" if [[ $OPT_BRIDGE_ != '' ]]; then brctl delif "$OPT_BRIDGE_" "$1" fi @@ -96,6 +96,7 @@ shift $(($OPTIND - 1)) if [[ $OPT_DEL_ == 'false' ]]; then if [[ $OPT_BRIDGE_ != '' && $OPT_AUTO_ == 'true' ]]; then brctl showmacs "$OPT_BRIDGE_" &>/dev/null || brctl addbr "$OPT_BRIDGE_" + ip link set up dev "$OPT_BRIDGE_" fi fromCmdline "createTun" "$@" else @@ -110,4 +111,4 @@ else fi fi -# vim: filetype=sh +## END OF FILE #################################################################