SunRay Solaris: run Synergy remotely via ssh
This is a sequel to my Linux entry. For SunRay, I divided into 2 scripts.
- Detect where active session is and save it into a file. I made this part into separate script so that I can use active session info when I want to run other commands like 'x11vnc'.
- On line:3, see $SUN_SUNRAY_TOKEN in your active SunRay session and hardcode it into this file. I used "auth.$USER". This is the value I get when I don't use IC card for authentication.
- On line:4, 'sunrayhost.domain' is any server in your SunRay host group. In our internal deployment, we have pool of 20 Solaris 10 SunRay servers. Just pick any one of them.
- Run synergyc.
#!/bin/bash
SYNGY_SERVER=$(ipconfig | sed -n '/Connection-specific DNS Suffix . : [A-z]/,+1p'|sed -n '2s/ IP Address. . . . . . . . . . . . : //p')
exec 3<&0
exec < ~/.sunray
read ACTIVE_HOST DISPLAY rest
exec 0<&3
exec 3<&-
plink -i d:/home/privateKey.ppk my_sol_id@$ACTIVE_HOST \
" \
pkill -U \$USER synergyc; \
LD_LIBRARY_PATH=~/bin DISPLAY=:$DISPLAY.0 ~/bin/synergyc --debug FATAL --name SunRay $SYNGY_SERVER \
"
#!/bin/bash
USER=my_sol_id
SUN_SUNRAY_TOKEN=auth.$USER
plink -i d:/home/privateKey.ppk $USER@sunrayhost.domain \
" \
/opt/SUNWut/bin/utswitch -l -k $SUN_SUNRAY_TOKEN | awk '\$2 >= 0'
" \
> ~/.sunray