[FreeNX-kNX] Re: Quick-and-dirty batch file for Windows NX client connecting to multiple FreeNX servers with different keys
Rick Stout
zipsonic at gmail.com
Wed Oct 20 16:22:08 UTC 2004
Thanks for the starter Doug.
Try this for a more generic approach:
Save this as /usr/bin/startnx
---Begin File ---
#!/bin/bash
nx_dir=/usr/NX
share_dir=$nx_dir/share
clientkey=client.id_dsa.key
MINPARAMS=1
if [ $# -lt "$MINPARAMS" ]
then
echo "Usage: startnx {session name}"
else
if ! [ -f ${share_dir}/${clientkey}.${1} ]
then
echo "Session key ${share_dir}/${clientkey}.${1} doesn't exist."
else
cp -f ${share_dir}/${clientkey}.${1} ${share_dir}/${clientkey}
${nx_dir}/bin/nxclient -session ${1}
fi
fi
---End File ---
Copy the key files for each session to their respective names. E.g.
nx1 -> /usr/NX/share/client.id_dsa.key.nx1
local -> /usr/NX/share/client.id_dsa.key.local
etc...
you will need to change the permissions to the key files:
chmod 666 /usr/NX/share/client.id_dsa.*
and make your script executable:
chmod 755 /usr/bin/startnx
Then invoke like this:
startnx nx1
NOTE: This should only be done when you are the only one on your client
system. If it is a shared system, then you keys will be visible to other
users.
Regards,
Rick Stout
Doug Burks wrote:
> Here's the equivalent quick-and-dirty shell script for Linux NX clients:
>
> #!/bin/bash
> nx_dir=/usr/NX
> share_dir=$nx_dir/share
> echo y | cp $share_dir/client.id_dsa.key.nx1 $share_dir/client.id_dsa.key
> $nx_dir/bin/nxclient -session "nx1"
>
> Again, the fourth line is long and may wrap in your reader. It is of the form:
> echo y | cp client...key.nx1 client...key
>
> Doug
>
>
> On Tue, 19 Oct 2004 20:57:28 -0400, Doug Burks <mubley at gmail.com> wrote:
>
>>Oops...correction below.
>>Doug
>>
>>On Tue, 19 Oct 2004 20:47:21 -0400, Doug Burks <mubley at gmail.com> wrote:
>>[snip]
>>
>>>4. Build a batch file named nx#.bat to copy the key and execute the NX session:
>>>rem Begin nx1.bat batch file
>>>@echo off
>>>rem Change the following line if you installed to a non-standard location
>>>set nx_dir="c:\program files\nx client for windows"
>>>echo y | copy %nx_dir%\share\client.id_dsa.key.nx1
>>>%nx_share_dir%\client.id_dsa.key
>>
>>The last two lines were supposed to be one line but wrapped, and there
>>was also a bug. It should read:
>>echo y | copy %nx_dir%\share\client.id_dsa.key.nx1
>>%nx_dir%\share\client.id_dsa.key
>>
>>So here's the corrected batch file in its entirety:
>>@rem Begin nx1.bat batch file
>>
>>
>>@echo off
>>set nx_dir="c:\program files\nx client for windows"
>>echo y | copy %nx_dir%\share\client.id_dsa.key.nx1
>>%nx_dir%\share\client.id_dsa.key
>>%nx_dir%\nxclient.exe -session nx1
>>rem End nx1.bat batch file
>>
>
> _______________________________________________
> FreeNX-kNX mailing list
> FreeNX-kNX at kde.org
> https://mail.kde.org/mailman/listinfo/freenx-knx
>
>
>
More information about the FreeNX-kNX
mailing list