You are not logged in.
Hi,
Up until I got hooked on gnome 3, I was using netcfg and I had it configured to only mount my NFS-shares when connected to my home-network.
I would like to do the same now I'm using networkmanager, and it seems that the nm-dispatcher is the way to go? Am I right? Does anyone have some recipes he/she would like to share?
THX!
Offline
I have the following file: /etc/NetworkManager/dispatcher.d/99nfs.sh contaning:
#!/bin/sh
IF=$1
STATUS=$2
if [ "${IF}" = "wlan0" ] && [ "${STATUS}" = "up" ]; then
ssid=`/usr/sbin/iwgetid --raw`
# logger "ssid: ${ssid}"
if [ "${ssid}" = "SSID_OF_MY_HOME_NETWORK" ]; then
logger "Home wlan0 up: mounting nfs"
if [ ! -f '/var/run/rpcbind.pid' ]; then
logger "starting nfs-common"
/etc/rc.d/nfs-common start
fi
mount /shared
mount /var/cache/pacman/
exit $?
fi
elif [ "${IF}" = "wlan0" ] && [ "${STATUS}" = "down" ]; then
logger "Home wlan0 down: unmounting nfs shares"
umount /shared
umount /var/cache/pacman/
fi
This works for me
Kind regards, enrique
Offline
Looks like it is working - THX!
/EDIT: spoke to soon. After a clean reboot, it doesn't work. Running the script with 'sh <scriptname> wlan0 up' works however...
I have triple checked the permissions (root:root and 755) and the file is in the /etc/NetwokManager/dispatcher.d/-folder. I had another file in that folder, but I removed it to make sure it was not blocking the execution of this script.
Anyone else have an idea?
Last edited by zenlord (2011-05-07 15:06:41)
Offline
My script in /etc/NetworkManager/dispatcher.d quit working after the pacman upgrade from networkmanager-0.8.998-3 to networkmanager-0.8.999-1.
The dispatcher script is supposed to be called with 2 parameters: the interface name of the device followed by the action (up, down, etc.)
Some limited troubleshooting indicated that the interface name, which used to be properly passed to the script as the first parameter, is empty.
I downgraded to the previous version (I downgraded network-manager-applet too) and the script began working again.
I stopped there because once my NFS mounts were working again I had other things to do - I guess I should submit an upstream bug report.
Offline
Bug reported upstream: https://bugzilla.gnome.org/show_bug.cgi?id=649773
Offline
Bug found and squashed in [master] - first real bugreport - yay!
Offline