User Tools

Site Tools


en:linux:scripts:55unmount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:linux:scripts:55unmount [2010/01/19 14:19] (current)
Line 1: Line 1:
 +===== /​etc/​pm/​sleep.d/​55unmount =====
 +
 +Script to unmount network mounts prior to suspend actions.
 +
 +<​code>​
 +#!/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
 +</​code>​
  
en/linux/scripts/55unmount.txt · Last modified: 2010/01/19 14:19 (external edit)