2
0
mirror of https://github.com/koreader/koreader synced 2024-11-13 19:11:25 +00:00
koreader/platform/cervantes/disable-usbms.sh
Frans de Jonge 668eee97fa
[CI] Add curly braces check (#5809)
Update shellcheck and shfmt to the latest version.

Fixes <https://github.com/koreader/koreader/issues/5152>.

Btw, you can apply shellcheck suggestions with a command like:

```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
2020-02-02 20:35:21 +01:00

27 lines
564 B
Bash

#!/bin/sh
lsmod | grep -q g_file_storage || exit 1
modprobe -r g_file_storage
sleep 1
PCB_ID=$(/usr/bin/ntxinfo /dev/mmcblk0 | grep pcb | cut -d ":" -f2)
DISK=/dev/mmcblk
if [ "${PCB_ID}" -eq 22 ] || [ "${PCB_ID}" -eq 23 ]; then
PARTITION="${DISK}0p7"
else
PARTITION="${DISK}0p4"
fi
MOUNT_ARGS="noatime,nodiratime,shortname=mixed,utf8"
dosfsck -a -w "${PARTITION}" >dosfsck.log 2>&1
mount -o "${MOUNT_ARGS}" -t vfat "${PARTITION}" /mnt/onboard
PARTITION=${DISK}1p1
[ -e "${PARTITION}" ] && mount -o "${MOUNT_ARGS}" -t vfat "${PARTITION}" /mnt/sd