home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / local / bin / rdesktopshell < prev    next >
Encoding:
Text File  |  2004-03-23  |  1.6 KB  |  51 lines

  1. #!/bin/sh
  2. #frontend for rdesktop RDP client.
  3. #(c) Barry Kauler 2004 www.goosee.com/puppy
  4.  
  5. . /etc/rdesktoprc
  6. HDRMSG="#Configuration file for rdesktop. See Network menu."
  7.  
  8. while [ 1 ]
  9. do
  10.  
  11. #RETSTR=`greq -t"rdesktop frontend" -p"rdesktop is a Remote Desktop Protocol client, invoked with the format" -p"\"rdesktop [options] server[:port]\"" -e"Options:" -e"Server:" -e"Port:" -a"HELP"`
  12. RETSTR=`Xdialog --wmclass "rdpshell" --title "rdesktop frontend" --stdout --left --separator "|" --help "" --3inputsbox "rdesktop is a Remote Desktop Protocol\nclient, invoked with the format:\nrdesktop [options] server[:port]" 0 0 "Options:" "$RDPOPTIONS" "Server:" "$RDPSERVER" "Port:" "$RDPPORT"`
  13.  
  14. RETVAL=$?
  15. case $RETVAL in
  16.  0) #ok
  17.   OPTIONS=`echo -n "$RETSTR" | cut -f 1 -d "|"`
  18.   SERVER=`echo -n "$RETSTR" | cut -f 2 -d "|"`
  19.   PORTx=`echo -n "$RETSTR" | cut -f 3 -d "|"`
  20.   if [ $PORTx ];then
  21.    PORTy=":${PORTx}"
  22.   else
  23.    PORTy=""
  24.   fi
  25.    echo "$HDRMSG" > /etc/rdesktoprc
  26.    echo "RDPOPTIONS=\"${OPTIONS}\"" >> /etc/rdesktoprc
  27.    echo "RDPSERVER=\"${SERVER}\"" >> /etc/rdesktoprc
  28.    echo "RDPPORT=\"${PORTx}\"" >> /etc/rdesktoprc
  29.   ERRSTR=`rdesktop ${OPTIONS} ${SERVER}${PORTy} 2>&1`
  30.   if [ ! $? -eq 0 ];then
  31.    #greq -t"rdesktop frontend" -p"Failed to execute:" -p"rdesktop ${OPTIONS} ${SERVER}${PORTy}" -p" " -p"rdesktop error message:" -p"${ERRSTR}" -a
  32.    Xdialog --wmclass "rdpshell" --title "rdesktop frontend" --infobox "Failed to execute:\nrdesktop ${OPTIONS} ${SERVER}${PORTy}\n\nrdesktop error message:\n${ERRSTR}" 0 0 20000
  33.   fi
  34.   break
  35.   ;;
  36.  1) #cancel
  37.   break
  38.   ;;
  39.  2) #help
  40.   dillo file:///usr/share/doc/rdesktop.htm &
  41.   ;;
  42.  *)
  43.   break
  44.   ;;
  45. esac
  46.  
  47.  
  48.  
  49. done
  50.  
  51.