]> git.pld-linux.org Git - packages/lxc.git/blobdiff - lxc_macvlan.init
Release 3. Fixes in init scripts.
[packages/lxc.git] / lxc_macvlan.init
index f2f9b10da34989001b252f603026c333e8e82425..ea703260981b22a95e6bf6f583386832c2c1fffe 100755 (executable)
@@ -39,12 +39,14 @@ fi
 # If not defined MACVLAN_HWADDRESS, calculate it from MACVLAN_ADDRESS
 if [ -z "$MACVLAN_HWADDRESS" ]; then 
     MACVLAN_HWADDRESS=`echo $MACVLAN_ADDRESS | awk -F "/" '{print $1}' | awk -F "." '{ printf "00:16:3e:%x:%x:%x\n", $2, $3, $4 }'`
-    echo "MACVLAN_HWADDRESS not set, using calculated from MACVLAN_ADDRESS=${MACVLAN_ADDRESS} value: ${MACVLAN_HWADDRESS}"; 
+    # TODO: Print on start() only
+    # echo "MACVLAN_HWADDRESS not set, using calculated from MACVLAN_ADDRESS=${MACVLAN_ADDRESS} value: ${MACVLAN_HWADDRESS}"; 
 fi
 
 
 start() {
         msg_starting "LXC macvlan interface"
+       # set -x
        ip link add link $MACVLAN_DEV name $MACVLAN_NAME address $MACVLAN_HWADDRESS type macvlan mode bridge
        ip link set $MACVLAN_NAME up
        ip address add $MACVLAN_ADDRESS brd + dev $MACVLAN_NAME
@@ -57,12 +59,17 @@ start() {
 
 stop() {
         msg_stopping "LXC macvlan interface"
+       # set -x
        ip link set $MACVLAN_NAME down
        ip link del $MACVLAN_NAME
         RETVAL=$?
        [ $RETVAL -eq 0 ] && ok || fail
 }
 
+status() {
+       ip addr show $MACVLAN_NAME 
+}
+
 
 RETVAL=0
 
@@ -80,6 +87,7 @@ case "$1" in
        start
        ;;
   status)
+       status
        ;;
   *)
 
This page took 0.140694 seconds and 4 git commands to generate.