diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-10-23 15:38:57 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-10-23 15:39:35 +0200 |
commit | fd46d4cfd23783899dd0af370b2fa281126e1fb8 (patch) | |
tree | c52c74c046024501b47ef2c6b5618fb342833de1 | |
parent | 784abd6689deed3e192c28148863a76f93947d8c (diff) | |
download | vyatta-op-fd46d4cfd23783899dd0af370b2fa281126e1fb8.tar.gz vyatta-op-fd46d4cfd23783899dd0af370b2fa281126e1fb8.zip |
T1431: add an unattended image deletion option.
-rwxr-xr-x | scripts/vyatta-boot-image.pl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/vyatta-boot-image.pl b/scripts/vyatta-boot-image.pl index d3ca5e8..5057d3a 100755 --- a/scripts/vyatta-boot-image.pl +++ b/scripts/vyatta-boot-image.pl @@ -469,19 +469,21 @@ sub doDelete { exit 1; } - print "Are you sure you want to delete the\n\"$del_ver\" image? "; - print '(Yes/No) [No]: '; - $resp = <STDIN>; - if (!defined($resp)) { - $resp = 'no'; - } - chomp($resp); - $resp = lc($resp); - if (($resp ne 'yes') && ($resp ne 'y')) { - print "Image is NOT deleted. Exiting...\n"; - exit 1; + my $process_client = $ENV{'VYOS_HEADLESS_CLIENT'}; + if (!defined($process_client)) { + print "Are you sure you want to delete the\n\"$del_ver\" image? "; + print '(Yes/No) [No]: '; + $resp = <STDIN>; + if (!defined($resp)) { + $resp = 'no'; + } + chomp($resp); + $resp = lc($resp); + if (($resp ne 'yes') && ($resp ne 'y')) { + print "Image is NOT deleted. Exiting...\n"; + exit 1; + } } - if (-d $UNION_BOOT) { $boot_dir = $UNION_BOOT; } elsif (-d $DISK_BOOT) { |