Skip to content

Instantly share code, notes, and snippets.

@alecjacobson
Created June 25, 2021 20:57
Show Gist options
  • Save alecjacobson/348092cd4e0921179181f688f5a0547a to your computer and use it in GitHub Desktop.
Save alecjacobson/348092cd4e0921179181f688f5a0547a to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$#" -lt 2 ] ; then
echo "mine [username] [file/folder]"
echo "or"
echo "mine [username] [file/folder] [action]"
exit 1
fi
if [ "$#" -ne 3 ] ; then
action="list,add_file,search,delete,add_subdirectory,delete_child,file_inherit,directory_inherit,read,write,delete,append,execute"
else
action="$3"
fi
# change the ACL on a mac os x folder so that everyone _except_ [user] cannot read
echo -e "$1 allow $action\neveryone deny $action" | chmod -E $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment