From e56c340e809a7618e02117de50969baa0a648285 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 18 May 2009 15:29:45 -0700 Subject: [PATCH] xenserver: Only require confirmation for "vswitch restart" if interactive. When /etc/init.d/vswitch restart is invoked non-interactively (e.g. from a cron job), don't require interactive confirmation. Not that we should encourage such behavior, but this approach seems closer to what most Unix utilities do in similar situations. --- xenserver/etc_init.d_vswitch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index d5376902..573fb695 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -214,6 +214,10 @@ function stop_brcompatd { } function restart_approval { + if test ! -t 0; then + # Don't prompt if invoked non-interactively. + return 0 + fi cat <