[arch-general] Scripting assistance

Alfredo Palhares masterkorp at masterkorp.net
Thu Feb 23 04:04:28 EST 2012

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 

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

Alfredo Palhares

More information about the arch-general mailing list