Last active
August 29, 2015 14:05
-
-
Save cakyus/ba5c514565dfe3d6fd46 to your computer and use it in GitHub Desktop.
Auto-mount unmounted devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for DEVICE_PATH in `ls -1 /dev/sd*[1,2,3,4,5,6,7,8,9]` | |
do | |
DEVICE_IS_MOUNTED=`mount | grep $DEVICE_PATH | wc -l` | |
if [ $DEVICE_IS_MOUNTED = 1 ] | |
then | |
# skip mounted device | |
continue | |
fi | |
udisks --mount $DEVICE_PATH | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment