You are not logged in.

#1 2015-11-22 22:48:46

hippieben
Member
Registered: 2013-10-27
Posts: 218

Trouble getting networkmanager dispatcher to unmount nfs shares

I am using the script outlined in this wiki page https://wiki.archlinux.org/index.php/NF … dispatcher however it does not unmount the shares when disconnecting from the appropriate network.  Mounting works just fine. 

Any suggestions?

#!/bin/bash

# Find the connection UUID with "nmcli con show" in terminal.
# All NetworkManager connection types are supported: wireless, VPN, wired...
WANTED_CON_UUID="95aab9be-4f18-4956-8447-d9618dd3f6bb"

if [[ "$CONNECTION_UUID" == "$WANTED_CON_UUID" ]]; then

    # Script parameter $1: NetworkManager connection name, not used
    # Script parameter $2: dispatched event

    case "$2" in
        "up")
            mount -a -t nfs4,nfs
            ;;
        "pre-down");&
        "vpn-pre-down")
            umount -f -l -a -t nfs4,nfs >/dev/null
            ;;
    esac
fi

Offline

#2 2015-12-30 16:18:02

flateric
Member
Registered: 2007-08-28
Posts: 52

Re: Trouble getting networkmanager dispatcher to unmount nfs shares

Try change "pre-down" event to "down". This solve my problem with nfs unmounting.

Offline

Board footer

Powered by FluxBB