netup and netdown now use ~/private/interfaces.
authorFrancois Fleuret <francois@fleuret.org>
Tue, 8 Nov 2011 08:49:51 +0000 (09:49 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Tue, 8 Nov 2011 08:49:51 +0000 (09:49 +0100)
bashrc

diff --git a/bashrc b/bashrc
index b2af3d5..dbacd63 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -349,6 +349,10 @@ function netup () {
         return 1
     fi
 
+    if [[ -f "${HOME}/private/interfaces" ]]; then
+        ARGS="-i ${HOME}/private/interfaces ${ARGS}"
+    fi
+
     echo "Executing ${VT_GREEN_FG}[sudo ifup ${ARGS}]${VT_RESET}"
     sudo ifup ${ARGS}
 
@@ -372,6 +376,11 @@ function netdown () {
         # Otherwise, use the standard ifdown
         ARGS="$@"
     fi
+
+    if [[ -f "${HOME}/private/interfaces" ]]; then
+        ARGS="-i ${HOME}/private/interfaces ${ARGS}"
+    fi
+
     echo "Executing sudo ${VT_GREEN_FG}[ifdown ${ARGS}]${VT_RESET}"
     sudo ifdown ${ARGS}
 }