sort acl file based on filename
This commit is contained in:
parent
9b53611107
commit
743956cf15
2
Makefile
2
Makefile
@ -23,7 +23,7 @@ sd-users: ## Run this after adding new users
|
|||||||
|
|
||||||
.PHONY: save-perms
|
.PHONY: save-perms
|
||||||
save-perms: ## Saves the file permissions to ./acl. Run this after adding new files with correct permissions
|
save-perms: ## Saves the file permissions to ./acl. Run this after adding new files with correct permissions
|
||||||
getfacl --recursive root > acl
|
getfacl --recursive root | ./makepac/sort_acl.sh > acl
|
||||||
|
|
||||||
.PHONY: set-perms
|
.PHONY: set-perms
|
||||||
set-perms: ## Restores permissions of all files from ./acl
|
set-perms: ## Restores permissions of all files from ./acl
|
||||||
|
8
sort_acl.sh
Executable file
8
sort_acl.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
# Sorts the output of getfacl records to stdout
|
||||||
|
# Assumes filenames don't contain + and |
|
||||||
|
|
||||||
|
awk '
|
||||||
|
BEGIN { RS="\n\n"; FS="\n"; ORS="\n"; OFS="|"}
|
||||||
|
// { $2=$2; print }
|
||||||
|
' | sort -k 1,1 -t '|' | tr '\n' '+' | sed 's/+/\n\n/g' | sed 's/|/\n/g'
|
Loading…
Reference in New Issue
Block a user