svn commit: r251055 - user/des/zfs-backup

Dag-Erling Smørgrav des at FreeBSD.org
Tue May 28 09:26:49 UTC 2013


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


More information about the svn-src-user mailing list