29 lines
401 B
Plaintext
29 lines
401 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
TITLE=
|
||
|
LABEL=
|
||
|
ERROR=0
|
||
|
HEIGHT=8
|
||
|
WIDTH=50
|
||
|
|
||
|
while getopts "t:l:d:h:w:r" option; do
|
||
|
case "$option" in
|
||
|
l) LABEL="$OPTARG";;
|
||
|
t) TITLE="$OPTARG";;
|
||
|
h) HEIGHT="$OPTARG";;
|
||
|
w) WIDTH="$OPTARG";;
|
||
|
:) ERROR=1;;
|
||
|
?) ERROR=1;;
|
||
|
esac
|
||
|
done
|
||
|
|
||
|
if [ $ERROR -eq 1 ]; then
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if (whiptail --title "$TITLE" --yesno "$LABEL" $HEIGHT $WIDTH 3>&1 1>&2 2>&3) then
|
||
|
printf "yes"
|
||
|
else
|
||
|
printf "no"
|
||
|
fi
|