#!/bin/sh # This script fixes issius with sleep or suspend when a SD-card is mounted. case "${1}" in hibernate|suspend) /bin/sync # Find all SD/MMC-Devices for drive in $( /bin/ls /dev/mmcblk?p* ); do # Unmount each device /bin/umount ${drive} > /dev/null # If failed: abort suspend if [ $? -ne 0 ]; then # If the device really keeps mounted /bin/mount | /bin/grep ${drive} if [ $? -eq 0 ]; then exit 1; fi fi done ;; resume|thaw) # Mount all devices mentiond in /etc/fstab mount -a > /dev/null # # Find all SD/MMC-Devices # for drive in $( /bin/ls /dev/mmcblk?p* ); do # # If device is not mounted: Mount it # /bin/mount | /bin/grep ${drive} # if [ $? -ne 0 ]; then # /bin/mount {drive} > /dev/null # fi done ;; esac