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:38:57 +0200 |
commit | 2c8e8f701d488c404607afcb9273fec2edced9ba (patch) | |
tree | 2ac1c4a54635c6b65ead47fa318bd9067e8c816c /scripts | |
parent | a51378a8ccca76183df9c81cf9703d7fd172e066 (diff) | |
download | vyatta-op-2c8e8f701d488c404607afcb9273fec2edced9ba.tar.gz vyatta-op-2c8e8f701d488c404607afcb9273fec2edced9ba.zip |
T1431: add an unattended image deletion option.
Diffstat (limited to 'scripts')
-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) { |