You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
441B

  1. #!/bin/sh
  2. TITLE=
  3. LABEL=
  4. ERROR=0
  5. HEIGHT=25
  6. MENU_HEIGHT=16
  7. WIDTH=50
  8. while getopts "t:l:d:h:w:m:r" option; do
  9. case "$option" in
  10. l) LABEL="$OPTARG";;
  11. t) TITLE="$OPTARG";;
  12. h) HEIGHT="$OPTARG";;
  13. m) MENU_HEIGHT="$OPTARG";;
  14. w) WIDTH="$OPTARG";;
  15. :) ERROR=1;;
  16. ?) ERROR=1;;
  17. esac
  18. done
  19. if [ $ERROR -eq 1 ]; then
  20. exit 1
  21. fi
  22. shift $((OPTIND-1))
  23. whiptail --title "$TITLE" --menu "$LABEL" $HEIGHT $WIDTH $MENU_HEIGHT "$@" 3>&1 1>&2 2>&3