Re: Scripting assistance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello Pete, 

> When i am at home i would like the laptop to mount my NAS drive  on
> boot  always connect via ETH cable  never wiFi  but out if i connect
> via cable or wirless do not try to mount NAS drive , My thoughts
> Would it be possible to script it so that it checks for an specific MAC
> address before trying to mount the NAS  as IP address would not work
> lots  of 192.168.x.x networks  out there 

A very simple solution would use netcfg profiles for your home network and 
connect to the NAS server with the POST_UP= param[1].

This would make things easier for you because you will not have to connect to the NAS
on every boot (since you said its a laptop and i assume you use it on other places
than your home) and only connect to the netowk you desire, either by wireless or wired.
You can also add the PRE_DOWN to disconnect of your mount safely before disconnecting the 
network. 

If you desire you can set the network to start on boot (by simply adding the profile name to
your rc.conf) but this will make your boot a little slower if you're not on your home (like
connecting to your NAS does).

[1] https://wiki.archlinux.org/index.php/Netcfg#Execute_commands_before.2Fafter_interface_up.2Fdown


--
Regards, 
Alfredo Palhares


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux