-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed storage check issue with directory permissions
- Loading branch information
Showing
3 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# script to change permission of file | ||
|
||
# File variable to store location | ||
|
||
FILE="$1" | ||
|
||
if [[ ! -e "${FILE}" ]]; then | ||
# creating directory... | ||
mkdir -p "${FILE}" | ||
# write permission of other and group of file | ||
chmod 770 "${FILE}" | ||
chown -R bluecherry:bluecherry "${FILE}" | ||
elif [[ ! -d "${FILE}" ]]; then | ||
echo "FILE already exists but is not a directory" | ||
fi | ||
|
||
# find out if file has write permission or not | ||
#[ -w $FILE ] && W="Write = yes" || W="Write = No" | ||
[ -w $FILE ] && W=w || W='-' | ||
|
||
# find out if file has excute permission or not | ||
[ -x $FILE ] && X=x || X='-' | ||
|
||
# find out if file has read permission or not | ||
[ -r $FILE ] && R=r || R='-' | ||
|
||
#echo "$FILE permissions" | ||
echo "-$W$R$X" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters