$HOME over NFS with wpa_supplicant

I have grown very fond of having $HOME mounted with NFS, making all computers in the household share files. However, for computers that connect wirelesssly to the network - with wpa_supplicant - automatically mounting NFS with /etc/network/if-up.d/mountnfs does not really work out of hte box, mounting is tried before the computer has received an IP. As a remedy, insert a condition that effectively checks if the computer has an IP or not.

# Exit if we don't have any IP address
if [ -z `ifconfig | grep -C2 HWaddr | grep "inet addr"` ] ; then
    exit 0
fi

A more recent debian system of mine complained about this, and I rewrote it as

if ! test ifconfig | grep -C2 HWaddr | grep -q "inet addr" ; then
    exit 0
fi

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: oktober 17, 2019