Created
April 19, 2020 03:51
-
-
Save nexus166/ddeeefb25264fe602998b89fb92773ca to your computer and use it in GitHub Desktop.
OpenWRT encrypted microSD mount hook
This file contains hidden or 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
| if [ "$DEVNAME" = "sda3" ]; then | |
| if [ "$ACTION" = "add" ]; then | |
| /usr/sbin/cryptsetup luksOpen "/dev/$DEVNAME" "$DEVNAME" --key-file "/root/$DEVNAME.key" | |
| /usr/bin/mount "/dev/mapper/$DEVNAME" "/mnt/$DEVNAME" | |
| elif [ "$ACTION" = "remove"]; then | |
| /usr/bin/umount -r "/mnt/$DEVNAME" | |
| /usr/sbin/cryptsetup luksClose "$DEVNAME" | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment