mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
udisks
- adding quick and dirty automounter init script for fixed drives
This commit is contained in:
parent
33adb9312d
commit
70fc13f79f
25
packages/sysutils/udisks/init.d/14_mount-disks
Executable file
25
packages/sysutils/udisks/init.d/14_mount-disks
Executable 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
|
Loading…
x
Reference in New Issue
Block a user