View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 2 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Mar 04, 2009 11:46 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I'd like a bash wrapper script that will run on my FE machine and will insure that the MBE is up and running before running mythfrontend thus avoiding the screen prompting a user for the IP address of the backend which drives my wife nuts.

The script needs to:

1) Check to see if the NFS mount is active (/mnt/share in my case)

2a) If it's not active, try to mount it
2b) If it won't mount because the MBE nfs server is down, seep for 60s and try again looping indefinitely until the MBE server is up

3) Once the mount is active, run mythfrontend and exit

Here is the line to the mount in question from my /etc/fstab
Code:
192.168.2.14:/share /mnt/share nfs defaults,auto,noatime 0 0


I took a stab it this, but I'm not sure how to accomplishing the looping and my code isn't very elegant. Anyone out there particularly bash-savvy?

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 04, 2009 6:23 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
Something like this should get you started (not tested):
Code:
#!/bin/sh
while :
do
   [ -n "`mount | grep /mnt/share`" ] && {
      <whatever you want to do here>
      exit 0
   } || {
      mount /mnt/share
      sleep 5
   }
done

You could place this script at the end of your normal startup stuff and just let it exit when the share is active, or add whatever commands you like in place of <whatever you want to do here>.

We're assuming that if you can mount the NFS share then the backend is running? I would guess that rpc/portmappper is started before the backend, you'll want to verify.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu