[Opgelost] Script for rdesktop

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
Rosie

[Opgelost] Script for rdesktop

Post by Rosie »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Script

Post by xenopeek »

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.
Image
Habitual

Re: Script

Post by Habitual »

User avatar
Oscar799
Level 20
Level 20
Posts: 10398
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: Script for rdesktop

Post by Oscar799 »

Moved here from Newbie Questions,title edited to make subject matter clear
Image
Habitual

Re: Script for rdesktop

Post by Habitual »

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=" "
Rosie

Re: Script for rdesktop

Post by Rosie »

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
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Script for rdesktop

Post by xenopeek »

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:
Image
Rosie

[Opgelost] Script for rdesktop

Post by Rosie »

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
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: [Opgelost] Script for rdesktop

Post by xenopeek »

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/
Image
Locked

Return to “Scripts & Bash”