mirror of
https://github.com/gryf/wmdocklib.git
synced 2026-01-30 20:35:48 +01:00
not necessary: it has been implemented directly in python (pywmhdmon)
This commit is contained in:
@@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# tmount - toggle mount / eject
|
|
||||||
#
|
|
||||||
# usage: tmount mountpoint ejectable
|
|
||||||
#
|
|
||||||
# parameter mountpoint: the mount point, without trailing '/'
|
|
||||||
# ejectable: not empty indicates that the media is software ejectable
|
|
||||||
# action: if the indicated file system is not mounted, mounts it
|
|
||||||
# otherwise unmounts it
|
|
||||||
# if mounting fails or when unmounting, ejects software ejectable
|
|
||||||
# media.
|
|
||||||
|
|
||||||
if [ "$2" == "" ]; then eject=echo
|
|
||||||
else eject=eject
|
|
||||||
fi
|
|
||||||
|
|
||||||
mountpointIndicated=$1
|
|
||||||
mountpointFound=`df $1 | tail -1 | cut -d% -f2`
|
|
||||||
|
|
||||||
if [ $mountpointIndicated = $mountpointFound ]
|
|
||||||
then
|
|
||||||
|
|
||||||
umount $mountpointIndicated
|
|
||||||
$eject $mountpointIndicated
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
# my smartmedia does not mount correctly after a media change
|
|
||||||
# second try always succeeds. ask me why! if neither mount
|
|
||||||
# attempt succeeds, then attempt ejecting ejectable media
|
|
||||||
|
|
||||||
mount $mountpointIndicated || mount $mountpointIndicated || $eject $mountpointIndicated
|
|
||||||
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user