shareDir*: convenient script for acl-usage
This commit is contained in:
parent
0575ae669c
commit
b7831f22f1
2 changed files with 32 additions and 0 deletions
16
shareDirGroup.sh
Executable file
16
shareDirGroup.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]] || [[ -z "$2" ]] ; then
|
||||||
|
echo "usage: $0 user dir [mode]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
USER=$1
|
||||||
|
DIR=$2
|
||||||
|
MODE=${3:-"rwX"}
|
||||||
|
|
||||||
|
if [[ ! -d "$DIR" ]] ; then
|
||||||
|
echo $DIR not a directory
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
setfacl -m "g:$USER:$MODE" -m "d:g:$USER:$MODE" -m "d:m:$MODE" -m "m:$MODE" -R "$DIR"
|
16
shareDirUser.sh
Executable file
16
shareDirUser.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]] || [[ -z "$2" ]] ; then
|
||||||
|
echo "usage: $0 user dir [mode]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
USER=$1
|
||||||
|
DIR=$2
|
||||||
|
MODE=${3:-"rwX"}
|
||||||
|
|
||||||
|
if [[ ! -d "$DIR" ]] ; then
|
||||||
|
echo $DIR not a directory
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
setfacl -m "u:$USER:$MODE" -m "d:u:$USER:$MODE" -m "d:m:$MODE" -m "m:$MODE" -R "$DIR"
|
Loading…
Add table
Reference in a new issue