noob how-to questions about

Soldato
Joined
22 Oct 2002
Posts
8,458
Location
Near Cheltenham
I only dabble in linux, mainly for tweaking my QNAP NAS etc..

Since I've just got an embedded linux Media Streamer, I've needed to do a couple of things that elude my knowledge, and google isn't giving me digestable answers.. So if any kind soul could help..


1. 'joining' Directories - Something I've used Junctions for in windows, but I want to join two directories together to aggregate their contents into a read only pseudo directory? Can I do this? Or perhaps I'm remembering incorrectly, maybe I need to symlink every sub directory from both folders into my pseudo folder? In which case how do I script that? Can it be done, i.e. a 'for every folder in x..'

2. In a startup script, I want to wait until the network adapter has got an IP address (As I want to then mount some network shares to some local directories).. I use mount -t cifs //server/share /local_folder -o,username=x,password=x in a startup script, but currently, I have to use a 'sleep 60' to make sure the wireless dongle has been picked up and connected before running the mount commands.. if I could easily script it so it waits for the connection (say checks every 6 seconds upto 20 times) then it should be a bit more efficient..

Thanks..
 
Last edited:
1. Are they separate drives? I'd use LVM in this case.

2.
Code:
#! /bin/bash

main()
{
    ping -c google.co.uk > /dev/null
    if [ "$?" -eq 0 ] 
    then
        echo 'waiting..';
		sleep 15
		main
    else
        mount -t cifs //server/share /local_folder -o,username=x,password=x
    fi
}

main

Thanks Mike :) I'll see if I have access to lvm in this embedded version, it sounds exactly what I need from googling it!
 
Back
Top Bottom