User Tools

Site Tools


en:linux:scripts:55unmount

/etc/pm/sleep.d/55unmount

Script to unmount network mounts prior to suspend actions.

#!/bin/bash

# IMPORTANT: There is no need for unmounting
# as long as -o reconect option is used with
# sshfs.

function UnmountNetworkMounts()
{
	logger "Unmounting network disks"
	mount|grep fuse.sshfs|awk '{print $3}'|while read mount
	do
		logger "    * unmounting $mount"
		fusermount -u "$mount"
	done
}

case $1 in
    hibernate)
		#UnmountNetworkMounts
        ;;
    suspend)
		#UnmountNetworkMounts
        ;;
esac
en/linux/scripts/55unmount.txt · Last modified: 2010/01/19 14:19 (external edit)