X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fclass%2F40-parse-profiles.sh;h=cb11c176f45a4c7f5474f41e81777e5ae2af69b3;hb=fd75a734a7149cf203553d36270482af37e680da;hp=2e58bc35506f6523e2e1983da8253fcbc9c3d74c;hpb=da61a304a10de72288782a9d872769fe44576f50;p=automated-distro-installer diff --git a/fai/config/class/40-parse-profiles.sh b/fai/config/class/40-parse-profiles.sh index 2e58bc3..cb11c17 100755 --- a/fai/config/class/40-parse-profiles.sh +++ b/fai/config/class/40-parse-profiles.sh @@ -1,9 +1,8 @@ - #! /bin/bash # parse *.profile and build a curses menu, so the user can select a profile # -# (c) 2015 by Thomas Lange, lange@informatik.uni-koeln.de +# (c) 2015 by Thomas Lange, lange@cs.uni-koeln.de # Universitaet zu Koeln if [ X$FAI_ACTION = Xinstall -o X$FAI_ACTION = Xdirinstall -o X$FAI_ACTION = X ]; then @@ -15,8 +14,10 @@ fi [ "$flag_menu" ] || return 0 out=$(tty) -tempfile=`(tempfile) 2>/dev/null` -tempfile2=`(tempfile) 2>/dev/null` +# save stdout and redirect stdout to tty +exec 4>&1 > $out +tempfile=$(mktemp) +tempfile2=$(mktemp) trap "rm -f $tempfile $tempfile2" EXIT INT QUIT # declare the data structure, use associative arrays @@ -148,8 +149,7 @@ while true; do dialog --clear --item-help --title "FAI - Fully Automatic Installation" --help-button \ --default-item "$default" \ --menu "\nSelect your FAI profile\n\nThe profile will define a list of classes,\nwhich are used by FAI.\n\n\n"\ - 15 70 0 "${par[@]}" 2> $tempfile 1> $out - + 15 70 0 "${par[@]}" 2> $tempfile _retval=$? case $_retval in 0) @@ -159,8 +159,10 @@ while true; do echo "No profile selected." break ;; 2) - dialog --title "Description of all profiles" --textbox $tempfile2 0 0 1> $out;; + dialog --title "Description of all profiles" --textbox $tempfile2 0 0 ;; esac done unset par ardesc arshort arlong arclasses list tempfile tempfile2 _parsed _retval line + +exec 1>&4 # restore stdout