X-Git-Url: http://git.onelab.eu/?p=util-vserver-pl.git;a=blobdiff_plain;f=scripts%2Fvuseradd;fp=scripts%2Fvuseradd;h=f64d62da30e06fc24ed797934decb8b32bd73c80;hp=c49fdd408a0e68cb63ff2ff2466a944dd93bbe52;hb=f4b68d7f85a261b88ecc9a26662ca532b64c84ca;hpb=0cae6a33d75271b7ec53f7ee2f314f92c0de8bc7 diff --git a/scripts/vuseradd b/scripts/vuseradd index c49fdd4..f64d62d 100755 --- a/scripts/vuseradd +++ b/scripts/vuseradd @@ -39,11 +39,15 @@ usage() } # Get options -while getopts "t:" opt ; do +ISOLATE=false +while getopts "it:" opt ; do case $opt in t) TYPE="$OPTARG" ;; + i) + ISOLATE=true + ;; *) usage ;; @@ -77,10 +81,17 @@ if [ ! -d $__CONFDIR/$NAME ] ; then HAS_VSERVERDIR=0 fi - $_VSERVER $NAME build -m skeleton --context $USERID \ + if [ "$ISOLATE" = "true" ] ; then + $_VSERVER $NAME build -m skeleton --context $USERID \ + --interface nodev:`hostname -i` \ + --flags persistent,~info_init + else + $_VSERVER $NAME build -m skeleton --context $USERID \ --interface nodev:`hostname -i` \ - --interface nodev:127.0.0.1 \ + --interface nodev:127.0.0.1 \ --flags persistent,~info_init + fi + RETVAL=$? DIR=$__CONFDIR/$NAME if [ $RETVAL -ne 0 ] ; then @@ -91,7 +102,11 @@ if [ ! -d $__CONFDIR/$NAME ] ; then echo default > $DIR/apps/init/mark # Set persistent for the network context - echo persistent,lback_allow > $DIR/nflags + if [ "$ISOLATE" = "true" ]; then + echo persistent,lback_allow,hide_lback,lback_remap > $DIR/nflags + else + echo persistent,lback_allow > $DIR/nflags + fi # Set default capabilities echo "CAP_NET_RAW" > $DIR/bcapabilities