From patchwork Tue Aug 12 19:08:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 4714661 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8B873C0338 for ; Tue, 12 Aug 2014 19:08:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A96AC2010F for ; Tue, 12 Aug 2014 19:08:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBE1C2010E for ; Tue, 12 Aug 2014 19:08:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754795AbaHLTIZ (ORCPT ); Tue, 12 Aug 2014 15:08:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19442 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754794AbaHLTIX (ORCPT ); Tue, 12 Aug 2014 15:08:23 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7CJ8Nmi015053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Aug 2014 15:08:23 -0400 Received: from bighat.boston.devel.redhat.com (bighat.boston.devel.redhat.com [10.19.60.55]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7CJ8NHu012384 for ; Tue, 12 Aug 2014 15:08:23 -0400 From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] server: Added -A flag which will cause server script to ask to mount. Date: Tue, 12 Aug 2014 15:08:06 -0400 Message-Id: <1407870486-7215-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By default the server script will no longer ask to mount. Use the new -A flag to restore the asking about the mount Signed-off-by: Steve Dickson --- server | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/server b/server index 439c96f..e63f6d5 100755 --- a/server +++ b/server @@ -11,6 +11,7 @@ # -c use cachefs; need to specify cachefs mount # options with -o # -N passes repeat "passes" times +# -A Ask before doing the mount [default: no] # mnt_options arg to -o mount options # server_path path to mount from server # mntpoint path to mount on locally @@ -19,15 +20,16 @@ Program=`basename $0` InitFile="./tests.init" -USAGE="usage: $Program [-a|-b|-g|-s|-l|-c] [-f|-t|-n|-h|-C] [-o mnt_options] [-p server_path] [-m mntpoint] [-N passes] server_name" +USAGE="usage: $Program [-a|-b|-B|-g|-s|-l|-c] [-f|-t|-n|-h|-C] [-o mnt_options] [-p server_path] [-m mntpoint] [-N passes] server_name" # defaults . $InitFile export PATH CFLAGS LIBS MOUNT UMOUNT MNTOPTIONS passes="1" +askt2mnt="no" -set - `getopt abcCfglhm:N:no:p:st $*` +set - `getopt aAbcCfglhm:N:no:p:st $*` if [ $? != 0 ] then @@ -40,6 +42,7 @@ do -a|-b|-g|-s|-l) TEST=$c; shift ;; -f|-n|-t) TESTARG=$c; shift ;; -c) cachefs="yes"; shift ;; + -A) ask2mnt="yes"; shift ;; -C) CIFS="yes"; export CIFS; shift ;; -h) HARDLINKS=n; export HARDLINKS; shift ;; -m) USRMNTPOINT=$2; shift; shift ;; @@ -124,18 +127,20 @@ HOSTNAME=`hostname` HOSTNAME=`expr $HOSTNAME : '\([^.]*\)'` NFSTESTDIR=$MNTPOINT/$HOSTNAME.test export NFSTESTDIR -echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC" -read ans -case $ans in - Y*|y*) - ;; - *) - echo "Terminating ($MNTPOINT left mounted)." - exit 1 - ;; -esac - +if test $ask2mnt = "yes" +then + echo $DASHN "Start tests on path $NFSTESTDIR [y/n]?" "$BLC" + read ans + case $ans in + Y*|y*) + ;; + *) + echo "Terminating ($MNTPOINT left mounted)." + exit 1 + ;; + esac echo "" +fi if test $passes = "1" then