Fix permission fixer
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
ARCH=`uname -m`
|
||||
if [[ $ARCH == "arm64" ]]; then
|
||||
PREFIX="/opt/homebrew/"
|
||||
else
|
||||
PREFIX="/usr/local"
|
||||
fi
|
||||
|
||||
function set_permissions {
|
||||
echo "----------"
|
||||
echo "Disabling Quarantine for Casks ..."
|
||||
echo "----------"
|
||||
find /usr/local/Caskroom -name *.app -exec bash -c "xattr -d com.apple.quarantine {} 2> /dev/null" \;
|
||||
find /usr/local/Caskroom -type f -perm +111 -exec bash -c "xattr -d com.apple.quarantine {} 2> /dev/null" \;
|
||||
find $PREFIX/Caskroom -name *.app -exec bash -c "xattr -d com.apple.quarantine {} 2> /dev/null" \;
|
||||
find $PREFIX/Caskroom -type f -perm +111 -exec bash -c "xattr -d com.apple.quarantine {} 2> /dev/null" \;
|
||||
find /Applications/ -name *.app -exec bash -c 'xattr -d com.apple.quarantine "{}" 2> /dev/null' \;
|
||||
find /Applications/ -type f -perm +111 -exec bash -c 'xattr -d com.apple.quarantine "{}" 2> /dev/null' \;
|
||||
}
|
||||
@@ -45,12 +52,12 @@ function diagnostics {
|
||||
}
|
||||
if [[ $* == *--help* ]]; then
|
||||
echo "Usage: $0 [option]"
|
||||
echo "Default options: --brew-update --cleanup --diagnostics --permission-fix"
|
||||
echo "Default options: --brew-update --cleanup --diagnostics"
|
||||
echo -e "Options:\n\t--brew-update\n\t--cleanup\n\t--diagnostics\n\t--permission-fix\n\t--system-update"
|
||||
fi
|
||||
|
||||
if [[ -z $* ]]; then
|
||||
set -- "$*" "--brew-update --cleanup --diagnostics --permission-fix"
|
||||
set -- "$*" "--brew-update --cleanup --diagnostics"
|
||||
fi
|
||||
|
||||
if [[ $* == *--system-update* ]]; then
|
||||
|
||||
Reference in New Issue
Block a user