Why are you executing this 'in a loop' (in cron) btw?
Main Topics
Browse All TopicsI have a linux script, that is scheduled in the crontab to run every minute.
This script, looks at a file (startbrowserext) and read the one line contained in that file.
if it says: "open", then the script opens firefox and then changes the text in the file to "donotopen"
if it says "donotopen" it does nothing.
Basically the text is set to "open" by an external program in which case the script opens firefox.
I have created a script, that reads from the file as below, but not sure how to change the text to "donotopen" once it opened the browser.
The code so far:
#!/bin/sh
fname="startbrowserext"
exec<$fname
while read line
do
echo $line;
case "$line" in
"open")
echo "firefox"
export DISPLAY=":0.0"
firefox http://localhost:8080/ZAM
;;
esac
done
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I tried the code and it opens the browser, but then it closes it down immiately. It also doesn't change open to donotopen.
I tried adding the line echo "donotopen" >$fname to my bit of code, and that works, the browser stays open
echo "donotopen" >$fname
export DISPLAY=":0.0"
firefox http://localhost:8080/ZAM
but it doesn't always change the open to do not open (sometimes it opens 3 browser instances before it changes it)
The reason why I need to loop it is because the browser is displaying a playlist. The playlist is updated externally, and when its updated the browser needs to be shut down - while the update happens - and then reopened. The update can happen any time of the day any number of times, so I sort of have to listen out for it really. Hence the loop.
yes, I had to change that to firefox --display=:0.0 http://localhost:8080/ZAM && echo $DO_NOT_OPEN >$FNAME
The crontab
* * * * * /home/usera/startbrowser.s
I changed the code like you suggested... it doesn't like 'openURL(http://localhost:
export DISPLAY=":0.0"
firefox http://localhost:8080/ZAM && echo $DO_NOT_OPEN >$FNAME &
All instances of firefox are closed, pgrep firefox comes back with nothing.
When the script first runs it opens up the browser, but does not change the open to donotopen
and when I check the processes running, there are 2
e.g.
root 17171 0.0 0.1 2764 1236 ? S 15:38 0:00 /bin/sh /usr/bi
root 17177 8.5 7.3 293752 57280 ? SLl 15:38 0:02 /usr/lib/firefo
as the crontab is running this every minute, in a minute another browser opens up and this seem to change the open to donotopen. when I check the processes running, there is no new process but the exact same as before.
Is that paculiar?
What is ReloadEvery extention?
Would that be redirecting the URL somewhere else and then back?
I was thinking about doing that, but not sure how.
The browser has a vlc plugin.. for which I need to specify the target playlist (playlist.m3u) file.
This lists all the movies to play, which are sitting in a folder.
When I upload a new playlist and the new movies to play... the browser needs to switch over. If I didn't stop it, it would crash... as it wouldn't be able to find the playlist or the movie files
Business Accounts
Answer for Membership
by: CEHJPosted on 2009-01-28 at 04:59:55ID: 23485952
I would try something like the following:
Select allOpen in new window