grml-addtun: reworked interface activation code
authorMichael Gebetsroither <michael.geb@gmx.at>
Tue, 16 Oct 2007 20:45:18 +0000 (22:45 +0200)
committerMichael Gebetsroither <michael.geb@gmx.at>
Tue, 16 Oct 2007 20:45:18 +0000 (22:45 +0200)
debian/changelog
sbin/grml-addtun

index d71bfbd..45efe83 100644 (file)
@@ -1,14 +1,15 @@
 grml-network (0.1.13) unstable; urgency=low
 
+  [ Michael Prokop ]
+  * some small typo fixes
+
   [ Michael Gebetsroither ]
   * added grml-addtun for tun/tap device handling
   * added manpage for grml-addtun
   * added uml-utilities to Suggests
+  * grml-addtun: reworked interface activation code 
 
-  [ Michael Prokop ]
-  * some small typo fixes
-
- -- Michael Prokop <mika@grml.org>  Tue, 16 Oct 2007 00:36:19 +0200
+ -- Michael Gebetsroither <gebi@grml.org>  Tue, 16 Oct 2007 22:44:41 +0200
 
 grml-network (0.1.12) unstable; urgency=low
 
index 256de5a..109cc6f 100755 (executable)
@@ -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