#!/bin/bash # Written by Shawn Jackson for i-worx Enterprises Inc on November 14, 2008 # Copyright 2008 i-worx Enterprises Inc. # You may use and redistribute this script, in whole or in part, providing you # include this notice and do not distribute it as a part of a commercial product. # Get number of active Kaseya RDP connections prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` echo $prevOpenConnections # Execute the noActiveX... file wine $1 & # Wait until there is another Kaseya RDP listening session/port until [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -gt $prevOpenConnections ]; do echo Current: `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` echo Prev: $prevOpenConnections # If fewer connections are open than initially (one was closed) then update prevOpenConnections if [ `netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` -lt $prevOpenConnections ]; then prevOpenConnections=`netstat -lnp | grep "wineserver\|noActiveX" | grep -c 0.0.0.0:9...` fi sleep 1 done # Now that there is a new Kaseya RDP listening attempt to connect to each. # This is a bit of a hack, but only the new session will accept your connection. var=`netstat -lnp | grep "wineserver\|noActiveX" | grep -o 0.0.0.0:9...` listeningsessions=(`echo $var`) for i in "${listeningsessions[@]}"; do echo /usr/bin/rdesktop -T $i -f $i /usr/bin/rdesktop -T $i -f $i & sleep 1 done
chmod a+x krdpexec
darcementEasier way,,,, google ie4linux and follow the directions for installing IE. Then you can install vnc from the .exe, you'll need to start the vncviewer--listen before you connect, or set it to start when you open IE. It works really well.
efanningThis is awesome, thank you. One question/problem I'm having, however, I can't find the spot to do the vncviewer--listen. It never prompted me to download the exe file for the VNC.