-
Notifications
You must be signed in to change notification settings - Fork 2
/
chkacl
executable file
·29 lines (23 loc) · 871 Bytes
/
chkacl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# script: check if acl if enabled for some path
# Author: Alejandro hurtado <[email protected]>
#
SCRIPTPATH=`dirname "$(readlink -f $0)"`
#colors in echo
source $SCRIPTPATH/echoc
# Determine what the mount point for the path is:
#MOUNT_POINT=$(df -P $1 | tail -n 1 | awk '{print $6}')
MOUNT_POINT=$($SCRIPTPATH/getmountpoint $1)
# Get the mount options for the path:
MOUNT_OPTS=$(awk '$2=="'$MOUNT_POINT'" { print $4 }' /proc/mounts)
# Check to see if acl is one of the mount points:
echo $MOUNT_OPTS | tr , \\\n | grep '^acl$' -q
if [ $? -eq 0 ]; then
exit 0
else
echoc $red "ACL not instaled or disabled" "b";echo
echoc $red "May be you needd install ACL: sudo apt-get install acl"; echo
echoc $red "put acl option in /etc/fstab at mountpoint $MOUNT_POINT ";echo
echoc $red "sudo /bin/mount -o remount $MOUNT_POINT";echo
exit 1
fi