LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 08-03-2004, 01:27 PM   #1
chr0no
LQ Newbie
 
Registered: Aug 2004
Location: Dominican Republic
Distribution: Mandrake 10
Posts: 2

Rep: Reputation: 0
Post Need to make a start up script


i not a wizard on linux, i used for certein things, i need to make a script to make mozilla o epiphany web browser open up 3 diferents pages every time i turned the computer on. i wanna do this because i have about 70 computers running the same system and i have to go one by one open the browsers and typing the pages. is there any way of how to make this script. i'm running mandrake 10.0. i'll appreciate any help. thanks
 
Old 08-03-2004, 01:43 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
do you need for the three pages to be opened in separate windows or in separate tabs in the same window???
 
Old 08-03-2004, 03:14 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i made this script for you... i've tried it with my firefox and it seems to work fine... but i'm a newbie, so i'm sure it has lot's of room for improvement... having said that, it basically does what it needs to do, it opens a new window and opens three URLs in three different tabs...


Code:
#!/bin/sh

# Put the URLs here:
URL1="http://www.slackware.com"
URL2="http://www.debian.org"
URL3="http://www.redhat.com"

# Check if Mozilla is already running:
mozilla -remote "ping()" &> /dev/null

# If it is, use that process to open the new window: 
if [ $? == "0" ]; then
exec mozilla -remote "openURL($URL1,new-window)" &
sleep 2
exec mozilla -remote "openURL($URL2,new-tab)" &
exec mozilla -remote "openURL($URL3,new-tab)" &

# If it's not, start a new Mozilla process:
else
exec mozilla $URL1 &
sleep 3

# Open the other two URLs in new tabs:
exec mozilla -remote "openURL($URL2,new-tab)" &
exec mozilla -remote "openURL($URL3,new-tab)" &
fi

i couldn't find a way to make it work without the "sleep" commands, as if you try and open a tab before the window has come all the way up on the screen it fails (unless a window was already open, in which case the tabs would open in that window and the window with URL1 would be separate)...

try commenting the sleeps and you'll see you start getting errors... i know that mozilla takes a lot longer to load than firefox, so if you're getting the window errors, try increasing the sleep time a little... the sleep time you need depends on how fast your computer is, and how long it takes to get the window up...

okay man, please let me know if this works for you...

good luck...


Last edited by win32sux; 08-03-2004 at 03:35 PM.
 
Old 08-05-2004, 10:20 AM   #4
chr0no
LQ Newbie
 
Registered: Aug 2004
Location: Dominican Republic
Distribution: Mandrake 10
Posts: 2

Original Poster
Rep: Reputation: 0
by the way i need it for 3 differents windows thanks...
 
Old 08-05-2004, 10:46 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
just change the "new-tabs" to "new-windows"...

Code:
#!/bin/sh

# Put the URLs here:
URL1="http://www.slackware.com"
URL2="http://www.debian.org"
URL3="http://www.redhat.com"

# Check if Mozilla is already running:
mozilla -remote "ping()" &> /dev/null

# If it is, use that process to open the new window: 
if [ $? == "0" ]; then
exec mozilla -remote "openURL($URL1,new-window)" &
sleep 2
exec mozilla -remote "openURL($URL2,new-window)" &
exec mozilla -remote "openURL($URL3,new-window)" &

# If it's not, start a new Mozilla process:
else
exec mozilla $URL1 &
sleep 3

# Open the other two URLs:
exec mozilla -remote "openURL($URL2,new-window)" &
exec mozilla -remote "openURL($URL3,new-window)" &
fi

Last edited by win32sux; 08-05-2004 at 10:47 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can i make a script or program make a phone call? nephish Linux - Software 2 08-15-2005 09:02 PM
Start up script... podollb Linux - Software 3 10-19-2004 04:38 PM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 11:00 AM
How to create a tiny script and make it start automatically tchigi Linux - Newbie 2 11-28-2003 03:48 AM
How to make X start only once? JohnGalt00 Linux - General 9 09-09-2003 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 02:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration