LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Autostart Rdesktop through batch with loop (https://www.linuxquestions.org/questions/linux-newbie-8/autostart-rdesktop-through-batch-with-loop-683116/)

Dutch2005NL 11-13-2008 06:51 AM

Autostart Rdesktop through batch with loop
 
OK i am relative new to linux so i decided to install ubuntu, wich works great, here at work we use thinstation/thinclients, in windows i would make a .bat file, state

Code:

@echo off
START /w rdesktop -f -z sbc
START /w rdesktop.bat

Wich basically makes sure that IF rdesktop is closed, the batch file just makes sure rdesktop is reopened /w corect parameters..

Now the trick is.... how to do so in linux...

i suppose a .bat wont work?

i think its going to be a bash/bin? kind of script?

acid_kewpie 11-13-2008 06:58 AM

while [ 1 ]; do rdesktop -a -b -c -d; done

your recursion is pretty horrible. every time you run it round you spawn another depth of recursion. if you close remote desktop 20 times you have 20 instances of the batch file running, each one waiting on it's spawned clone. yuck. in batch just use a label and a goto statement instead.

Dutch2005NL 11-13-2008 07:14 AM

Quote:

Originally Posted by acid_kewpie (Post 3340545)
while [ 1 ]; do rdesktop -a -b -c -d; done

your recursion is pretty horrible. every time you run it round you spawn another depth of recursion. if you close remote desktop 20 times you have 20 instances of the batch file running, each one waiting on it's spawned clone. yuck. in batch just use a label and a goto statement instead.

thnx i'll try it out in a second :)

well i could add a exit at the end of the script... so it closes itself ;-), then again, its mostly office workers... they turn the pc on at 8-9AM and turn it off at 5-6PM, they never log out, only at some places the comp would swap between 3 shifts, and gets turned out a-lot too...

thnx for the insights though :)


my 2nd questions would be...

i guess i open a editor as root (sudo) insert the command, then were & how do i safe it? without an extension? script COULD be saved in the users my documents... as the dont use the local machine, and dont have knowledge of linux at all... hardly windows experienc....


All times are GMT -5. The time now is 06:19 PM.