Skip to content

Instantly share code, notes, and snippets.

@MattMcNam
Last active February 26, 2022 00:29
Show Gist options
  • Save MattMcNam/c307762088c3119480fe4d15b39a9fe4 to your computer and use it in GitHub Desktop.
Save MattMcNam/c307762088c3119480fe4d15b39a9fe4 to your computer and use it in GitHub Desktop.
autofs script for AWS EFS IDs - uses amazon-efs-utils helper
#!/bin/bash
# Stripped down and tweaked version of auto.net
# This file must be executable to work! chmod 755!
key="$1"
echo "/" | awk -v key="$key" -v opts="-fstype=efs" -- '
BEGIN { ORS=""; first=1 }
{ if (first) { print opts; first=0 }; print "\\\n\t" $1, key ":" $1 }
END { if (!first) print "\n"; else exit 1 }
' | sed 's/#/\\#/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment