summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-05-06 13:27:39 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-05-06 13:27:39 -0500
commit0c519fbaacd7a7ef816e0250f4ae92fa05227089 (patch)
tree38d882e323e5227f12b726b44476b71dff07781a /scripts
parent86a7354d70cf53fe8f284b9f300507d5f90e298a (diff)
parent0ead82c97e51e16ddc7d2eeba6f5dd30aac7466a (diff)
downloadvyatta-op-0c519fbaacd7a7ef816e0250f4ae92fa05227089.tar.gz
vyatta-op-0c519fbaacd7a7ef816e0250f4ae92fa05227089.zip
Merge branch 'napa' of git.vyatta.com:/git/vyatta-op into napa
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-clear-conntrack8
-rwxr-xr-xscripts/vyatta-reboot.pl17
2 files changed, 16 insertions, 9 deletions
diff --git a/scripts/vyatta-clear-conntrack b/scripts/vyatta-clear-conntrack
index 99874a3..0979e4a 100644
--- a/scripts/vyatta-clear-conntrack
+++ b/scripts/vyatta-clear-conntrack
@@ -55,8 +55,12 @@ get_response () {
response=''
while [ -z "$response" ]
do
- echo -ne "\nThis will clear all currently tracked and expected connections. Continue? (Y/N) [N]: "
- response=$(get_response "N" "Y N")
+ if [ "$VYATTA_PROCESS_CLIENT" == "gui2_rest" ]; then
+ response="y"
+ else
+ echo -ne "\nThis will clear all currently tracked and expected connections. Continue? (Y/N) [N]: "
+ response=$(get_response "N" "Y N")
+ fi
if [ "$response" == "n" ]; then
exit 1
else
diff --git a/scripts/vyatta-reboot.pl b/scripts/vyatta-reboot.pl
index 4d34fee..eaef885 100755
--- a/scripts/vyatta-reboot.pl
+++ b/scripts/vyatta-reboot.pl
@@ -115,11 +115,12 @@ if ($action eq "reboot") {
if (defined $now) {
do_reboot($login);
} else {
- if (prompt("Proceed with reboot? [confirm]", -y1d=>"y")) {
+ if (defined($ENV{VYATTA_PROCESS_CLIENT} && $ENV{VYATTA_PROCESS_CLIENT} eq 'gui2_rest') ||
+ prompt("Proceed with reboot? [confirm]", -y1d=>"y")) {
do_reboot($login);
- } else {
- print "Reboot canceled\n";
- exit 1;
+ } else {
+ print "Reboot canceled\n";
+ exit 1;
}
}
}
@@ -155,9 +156,11 @@ if ($action eq "reboot_at") {
system("atrm $job");
print "\nReload scheduled for $time\n\n";
- if (! prompt("Proceed with reboot schedule? [confirm]", -y1d=>"y")) {
- print "Reboot canceled\n";
- exit 1;
+ if (!defined($ENV{VYATTA_PROCESS_CLIENT}) || $ENV{VYATTA_PROCESS_CLIENT} ne 'gui2_rest') {
+ if (! prompt("Proceed with reboot schedule? [confirm]", -y1d=>"y")) {
+ print "Reboot canceled\n";
+ exit 1;
+ }
}
@lines = `echo sudo /sbin/reboot | at $at_time 2>&1`;