#!/bin/dash

### localisation
export TEXTDOMAIN=get_app
. gettext.sh

APPTITLE="$(gettext 'Get Java GUI')"

if [ $(id -u) -ne 0 ]; then
	[ "$DISPLAY" ] && exec gtksu "$APPTITLE" "$0"
	echo "Must run as root." && exec su -c "$0"
fi

Xdialog --title "$APPTITLE" --yesno \
"$(gettext 'Running this program will download the latest version of')
$(gettext 'Java SE (JDK) and convert it to SFS.')

$(gettext 'Are you sure you want to continue?')" \
0 0 || exit

getjava.sh --update
getjava.sh --noprompt | Xdialog --no-cancel --title "$APPTITLE" --logbox - 0 0
