From owner-svn-src-user@FreeBSD.ORG Tue May 28 09:26:49 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0E8CBF85; Tue, 28 May 2013 09:26:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0050977A; Tue, 28 May 2013 09:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S9QmiS003700; Tue, 28 May 2013 09:26:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S9QmM5003699; Tue, 28 May 2013 09:26:48 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305280926.r4S9QmM5003699@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 28 May 2013 09:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r251055 - user/des/zfs-backup X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 09:26:49 -0000 Author: des Date: Tue May 28 09:26:48 2013 New Revision: 251055 URL: http://svnweb.freebsd.org/changeset/base/251055 Log: If stdin is not a tty, abort rather than prompt the user. Modified: user/des/zfs-backup/zfs-backup.sh Modified: user/des/zfs-backup/zfs-backup.sh ============================================================================== --- user/des/zfs-backup/zfs-backup.sh Tue May 28 09:25:58 2013 (r251054) +++ user/des/zfs-backup/zfs-backup.sh Tue May 28 09:26:48 2013 (r251055) @@ -105,6 +105,7 @@ if [ -z "$last" ] ; then info "It looks like this is the first backup from $fqsrc to $fqdst." \ "Continuing will DESTROY the contents of $fqdst, including any" \ "preexisting snapshots, and replace them with the contents of $fqsrc." + [ -t 0 ] || error "stdin is not a terminal - aborting" while :; do echo -n "Are you sure you want to proceed? (yes/no) " read answer