[Opgelost] Script for rdesktop

Forum rules
Before you post please read this

[Opgelost] Script for rdesktop

Postby Rosie on Wed Jul 27, 2011 1:12 pm

Hello

Who knows how to make a script in order to automate the rdp connection i make in the Terminal = rdesktop 192.168.0.115 -f for example (kind of batch I can write and then click on..?)

With thanks R
Last edited by Rosie on Thu Jul 28, 2011 1:28 pm, edited 1 time in total.
Rosie
Level 1
Level 1
 
Posts: 24
Joined: Sat Jul 23, 2011 6:47 am

Linux Mint is funded by ads and donations.
 

Re: Script

Postby xenopeek on Wed Jul 27, 2011 1:23 pm

You can either create a launcher for this in the main menu, or indeed a script. For launcher go to Control Center -> Main Menu, select a category where you want this command, click New Item and set command to your rdesktop line. Also give it a name, and you are done. (You can click the default icon to change it to something else.)

You could also create a small shell script. Create a text file, for example called Connect.sh, and put the following text in it:
Code: Select all
#!/bin/sh
rdesktop 192.168.0.115 -f

Either run "chmod +x Connect.sh", or mark the file as executable through the file browser. You can now double-click this file to run your script.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14969
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Script

Postby Habitual on Wed Jul 27, 2011 1:34 pm

What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2213
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: Script for rdesktop

Postby Oscar799 on Wed Jul 27, 2011 1:44 pm

Moved here from Newbie Questions,title edited to make subject matter clear
Image
"Don't fix it if it ain't broken,don't break it if you can't fix it" Husse
Registered Linux User #511789
User avatar
Oscar799
Level 18
Level 18
 
Posts: 8889
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: Script for rdesktop

Postby Habitual on Wed Jul 27, 2011 3:15 pm

Are these always going to be the for the same?
1.) IP
2.) username
3.) password

for this script?
because if they are then:
Code: Select all
#!/bin/bash
rdesktop ipp.addr.ess -u <username> -p <password> -f


else if you connect to more than 1 machine with more than 1 username with more than 1 password:
Code: Select all
#!/bin/bash

echo -n "IP...? "
read ANSWER1
for periods in "$@"
  do
   sed -e 's/\./\./' "$ANSWER1"
  done
   
echo -n "user...? "
read ANSWER2

echo -n "pass... "
read ANSWER3

rdesktop "$ANSWER1" -u "$ANSWER2" -p "$ANSWER3" -f
ANSWER3=" "
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2213
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: Script for rdesktop

Postby Rosie on Thu Jul 28, 2011 12:43 pm

Many thanks for your reactions but....

I copied and paste the script for several ip 's and users and saved the file as connect.sh.

So far so good, but how do i get this script working, if i click on the file de text editor opens with the script.

If i rightclick on the file i cannot make an excutable from it.

So how do i carry on right now ?

Thank you again

RdR
Rosie
Level 1
Level 1
 
Posts: 24
Joined: Sat Jul 23, 2011 6:47 am

Re: Script for rdesktop

Postby xenopeek on Thu Jul 28, 2011 1:00 pm

Rosie wrote:If i rightclick on the file i cannot make an excutable from it.

Right-click -> Properties -> Permissions tab -> check "Allow executing file as a program". Sorry, assumed you would know this or run the command I gave otherwise :wink:
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14969
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

[Opgelost] Script for rdesktop

Postby Rosie on Thu Jul 28, 2011 1:26 pm

Beste Vincent,

Ik neem aan dat je ook nederlands leest gezien je naam.
Nogmaals met dank, werkt perfect.
Ik ben maar net begonnen met Linux, dus nog behoorlijk onwetend over allerlei zaken.
Lijkt soms of ik weer teug ben in de goede oude DOS dagen.

Echter zeer gecharmeerd van dit prachtige Mint OS

En een onverwoestbaar help forum uiteraard...

Groet

Rinke
Rosie
Level 1
Level 1
 
Posts: 24
Joined: Sat Jul 23, 2011 6:47 am

Re: [Opgelost] Script for rdesktop

Postby xenopeek on Thu Jul 28, 2011 1:43 pm

Good to hear this worked for you! Lets stick to English here, so others can read and understand solutions and feedback also :wink: Perhaps also note down the Dutch Linux Mint forums: http://forum.linuxmint-nl.org/
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14969
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Linux Mint is funded by ads and donations.
 

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest