- adding quick and dirty automounter init script for fixed drives
This commit is contained in:
Stephan Raue 2010-04-12 01:04:08 +02:00
parent 33adb9312d
commit 70fc13f79f

View File

@ -0,0 +1,25 @@
#
# automount internal disks
#
# runlevels: openelec, textmode
progress "automount internal disks"
drive_dump () {
udisks --dump | tr -d ' ' | grep 'device-file:' | cut -d ':' -f2
}
show_info () {
udisks --show-info $2 | grep "$1:" | tr -d ' ' | cut -d ":" -f2
}
for DEVICE in `drive_dump`; do
REMOVABLE="`show_info "removable" $DEVICE`"
MOUNTED="`show_info "is mounted" $DEVICE`"
USAGE="`show_info "usage" $DEVICE`"
if [ "$REMOVABLE" = "0" -a "$MOUNTED" = "0" -a "$USAGE" = "filesystem" ]; then
udisks --mount "$DEVICE" >/dev/null
fi
done