# HG changeset patch # User Christophe Lincoln # Date 1269464609 -3600 # Node ID cd27820e187db8df4d888b71f65c432f87043a64 # Parent aa61397a447514b2bbda8edb4c21f93722398fdc subox: can save and remember passwd diff -r aa61397a4475 -r cd27820e187d tinyutils/subox --- a/tinyutils/subox Wed Mar 24 06:37:36 2010 -0400 +++ b/tinyutils/subox Wed Mar 24 22:03:29 2010 +0100 @@ -3,7 +3,7 @@ # Gtkdialog to execute program as root from a WM menu. # (c) SliTaz GNU/Linux 2008-2010 - GNU gpl. # -VERSION=20100314 +VERSION=20100324 # Usage. if [ -z "$1" ]; then @@ -26,7 +26,7 @@ export SU_CMD=$1 # Main window and root password default entry set to 'root'. -export SU_DIALOG=' +SU_DIALOG=' @@ -47,14 +47,29 @@ - + ' + +# Check if we have a saved passwd. +if [ -s $HOME/.config/slitaz/subox.conf ]; then + PASSWD=`cat $HOME/.config/slitaz/subox.conf` + [ -n "$PASSWD" ] && SU_DIALOG="$SU_DIALOG $PASSWD" +fi + +export SU_DIALOG=''${SU_DIALOG}' PASSWD + + + AUTOSAVE + false + @@ -63,6 +78,6 @@ ' -gtkdialog --center --program=SU_DIALOG +gtkdialog --center --program=SU_DIALOG > /dev/null exit 0