-
-
Save peci1/443062022352a3adc0df574584c9af44 to your computer and use it in GitHub Desktop.
OpenWRT: automount NTFS drive by UUID and before mountd comes into action and mounts it under /tmp/run/mountd
This file contains 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 /etc/rc.common | |
# This is a procd initscript, so put it in /etc/init.d/ | |
START=79 # Important: this number must be lower than the START number in /etc/init.d/mountd !!! | |
USE_PROCD=1 | |
PROGNAME="/usr/bin/ntfs-3g" | |
# Fill these values as desired | |
# You'll find the UUID by calling `blkid` and putting here either the UUID or UUID_SUB value (not PARTUUID). | |
uuid=94D6774FD677311A | |
# The folder is expected to already exist. If it doesn't, create it manually. | |
target=/mnt/exterak | |
find_device() { | |
device=$(blkid -sUUID | grep ${uuid} | cut -d: -f0) | |
} | |
start_service() { | |
logger -t mount-ntfs "Mounting NTFS drives" | |
find_device | |
"${PROGNAME}" "${device}" "${target}" | |
} | |
stop_service() { | |
logger -t mount-ntfs "Unmounting NTFS drives" | |
find_device | |
umount ${device} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment