diff options
author | martin f. krafft <madduck@madduck.net> | 2007-10-16 17:13:42 +0100 |
---|---|---|
committer | martin f. krafft <madduck@madduck.net> | 2007-10-16 17:13:42 +0100 |
commit | 36227ffe893c69b00567fde8b003f107e5c93e38 (patch) | |
tree | 677ec378f5f87b75e77290420858d019db0c3e28 /debian/bugscript | |
parent | 9b4b529d90760bee562dff4d585858a8695f7291 (diff) |
fixes to the bugscript, make it run without 3>&1
Diffstat (limited to 'debian/bugscript')
-rwxr-xr-x[-rw-r--r--] | debian/bugscript | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/debian/bugscript b/debian/bugscript index d663641c..f5c45c27 100644..100755 --- a/debian/bugscript +++ b/debian/bugscript @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # mdadm bug submission control script # @@ -7,16 +7,31 @@ # Copyright © martin f. krafft <madduck@debian.org> # distributed under the terms of the Artistic Licence 2.0 # -# $Id$ +# we need /bin/bash for readline and -n capabalities in the prompt(s) # set -eu +if ! command -v yesno >/dev/null; then + if [ -r /usr/share/reportbug/handle_bugscript ]; then + exec /usr/share/reportbug/handle_bugscript ". $0" /dev/stdout + fi + yesno() { + read -n1 -p"$1" REPLY + case "$REPLY" in + [yY]) REPLY=yep;; + [nN]) REPLY=nop;; + ('') REPLY="$2";; + esac + } + exec 3>&1 +fi + if [ ! -r /proc/mdstat ]; then echo "The local system does not have MD (RAID) support: no drivers loaded." echo "Without MD support, I cannot collect as much information as I'd like." #yesno "Are you sure you want to report a bug at this time? " yep - yesno "Hit any key to continue..." + yesno "Hit any key to continue..." yep #[ "$REPLY" = yep ] || exit 1 fi |