X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fchbind;h=25246449018b45982359d26586695c6d035da830;hb=6e8c9fef3c41764387d7782c275476f980ebd048;hp=75aa2a4f03fecaccc00099bae8e904f94f005133;hpb=e97918417e2f91e76024bee546366f2f0d43c281;p=util-vserver.git diff --git a/scripts/chbind b/scripts/chbind index 75aa2a4..2524644 100755 --- a/scripts/chbind +++ b/scripts/chbind @@ -29,7 +29,8 @@ function showHelp() { echo \ $"Usage: $1 [--silent] [--nid ] [--ip [/]] - [--bcast ] [--] * + [--lback ] [--bcast ] + [--] * --silent Do not print the addresses assigned. @@ -37,6 +38,8 @@ $"Usage: $1 [--silent] [--nid ] [--ip [/]] Network context id to use. --ip [/] IP address to bind to. +--lback + Loopback address for the network context. --bcast Broadcast address for the network context. @@ -57,9 +60,7 @@ the GNU General Public License. This program has absolutely no warranty." exit $1 } -$_VSERVER_INFO - FEATURE vnet || exec $_CHBIND_COMPAT "$@" - -tmp=$(getopt -o + --long ncap:,nid:,ip:,bcast:,disconnect,flag:,secure,silent,help,version -n "$0" -- "$@") || exit 1 +tmp=$(getopt -o + --long ncap:,nid:,ip:,bcast:,lback:,disconnect,flag:,secure,silent,help,version -n "$0" -- "$@") || exit 1 eval set -- "$tmp" OPT_CAPS=() @@ -69,6 +70,7 @@ OPT_FLAGS=() OPT_SECURE= OPT_SILENT= OPT_BCAST= +OPT_LBACK= OPT_IPS=() while true; do @@ -81,14 +83,22 @@ while true; do --flag) OPT_FLAGS=( "${OPT_FLAGS[@]}" "$2" ); shift;; --secure) OPT_SECURE=1;; --silent) OPT_SILENT=1;; - --ip) OPT_IPS=( "${OPT_IPS[@]}" "$2" ); shift;; + --ip) OPT_IPS=( "${OPT_IPS[@]}" --ip "$2" ); shift;; --bcast) OPT_BCAST=$2; shift;; + --lback) OPT_LBACK=$2; shift;; --) shift; break;; *) echo $"chbind: internal error; arg=='$1'" >&2; exit 1;; esac shift done +$_VSERVER_INFO - FEATURE vnet || exec $_CHBIND_COMPAT \ + ${OPT_NID:+--nid "$OPT_NID"} \ + ${OPT_SILENT:+--silent} \ + ${OPT_BCAST:+--bcast "$OPT_BCAST"} \ + "${OPT_IPS[@]}" \ + -- "$@" + create_cmd=( $_NCONTEXT --create --silentexist ${OPT_SILENT:+--silent} ${OPT_NID:+--nid "$OPT_NID"} ) @@ -107,12 +117,10 @@ chain_cmd=( "${chain_cmd[@]}" -- $_NADDRESS --add ${OPT_SILENT:+--silent} - ${OPT_BCAST:+--bcast "$OPT_BCAST"} ) + ${OPT_BCAST:+--bcast "$OPT_BCAST"} + ${OPT_LBACK:+--lback "$OPT_LBACK"} + "${OPT_IPS[@]}" ) -for ip in "${OPT_IPS[@]}"; do - chain_cmd=( "${chain_cmd[@]}" --ip "$ip" ) -done - migrate_cmd=( $_NCONTEXT ${OPT_SILENT:+--silent} ${OPT_DISCONNECT:+--disconnect} )