From ohcanada, 2 Months ago, written in Bash.
  1. #!/bin/bash
  2.  
  3. # loginwrapper.sh - Tester for ruby loginauth.rb
  4.  
  5. login_askpass()
  6. {
  7.   MESS1="Login"
  8.   USERPASS1=$(zenity --password --username --title="$MESS1")
  9. }
  10.  
  11. login_askpass
  12.  
  13. # extract username and password from USERPASS1, returned from zenity dialog
  14. USER1=${USERPASS1%|*}
  15. PASS1=${USERPASS1##*|}
  16.  
  17. # call external ruby auth script ...
  18. ./loginauth.rb "$USER1" "$PASS1"
  19.  
  20. # ... and check return value
  21. if [ $? -ne 0 ]; then
  22.   # bad return
  23.   exit 1
  24. else
  25.   # good return
  26.   mate-terminal --disable-factory --working-directory="/home/USER1"
  27. fi
captcha