Skip to content

Instantly share code, notes, and snippets.

@marissa999
Last active March 25, 2021 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marissa999/7a005b3c5fcae8aea20f0814ffe1af8d to your computer and use it in GitHub Desktop.
Save marissa999/7a005b3c5fcae8aea20f0814ffe1af8d to your computer and use it in GitHub Desktop.
#!/sbin/openrc-run
name="mount-sdcard"
description="Automount encrypted SD Card"
start() {
/sbin/cryptsetup open /dev/mmcblk1p1 sdcard --key-file=/etc/luks-keys/disk_secret_key
/bin/mount /dev/mapper/sdcard /sdcard
}
stop() {
/bin/umount /sdcard
/sbin/cryptsetup close sdcard
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment