Writing an installation-script for Minecraft, been trying to get the user to input password, check password and on wrong password as if the user would like to try again or abort. Finally came up with what seems a working solution (for adding a entry to the application-menu), but now I wonder if this unsafe in any way? Is there a better solution?
Code:
while ! zenity --password| sudo -S cat /dev/null >/dev/null; do
if $(zenity --question --text="Wrong password, would you like to cancel the installation?"); then
echo "no app-entry made, returning"
return;
fi
done
echo "$appEntry" | sudo -S tee ${launcher}
sudo -K # remove privilege
where appEntry is the text, launcher is the file.
I might add that I would like to use zenity, not gksu or similar.
Thanks
Bookmarks