From 9beeec4ef48369b488c774596ba2e8c47e0ce1e5 Mon Sep 17 00:00:00 2001
From: John Southworth <john.southworth@vyatta.com>
Date: Tue, 3 May 2011 17:24:55 -0500
Subject: Support non-interactive mode for webgui2

---
 scripts/vyatta-image-tools.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl
index 3a9bf08..fc8bfc8 100755
--- a/scripts/vyatta-image-tools.pl
+++ b/scripts/vyatta-image-tools.pl
@@ -202,6 +202,10 @@ sub curl_from {
 
 sub y_or_n {
   my ($msg) = @_;
+  my $process_client = $ENV{'VYATTA_PROCESS_CLIENT'};
+  if (defined $process_client){
+    return 1 if ($process_client =~ /gui2_rest/);
+  }
   print "$msg (Y/N): ";
   my $input = <>;
   return 1 if ($input =~ /Y|y/);
-- 
cgit v1.2.3