dotfiles/Utils/sldm.sh

28 lines
457 B
Bash
Raw Normal View History

2013-09-18 22:43:50 +00:00
#!/bin/bash
# sldm - Super Lightweight Device Mounter
#TODO: FIXME and make me nicer
devices=(/dev/sd??)
dontwant=sda
tomount=/media
for device in ${devices[@]}; do
last=$(echo $device | awk -F/ '{print $NF}')
if [ "${device#*$dontwant}" == "$device" ]; then
echo $device
mount | grep $device > /dev/null
if [ $? -ne 0 ]; then
echo "yop"
pa=$tomount/$last
mkdir -p $pa > /dev/null
mount $device $pa
fi;
echo $device
fi;
done;