Created
May 15, 2021 07:15
-
-
Save lancylot2004/7f2e260ff3460275dd66ae65f88d15f3 to your computer and use it in GitHub Desktop.
Gatekeeper Utility
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
#!/bin/bash | |
RED='\033[0;31m' | |
GRN='\033[0;32m' | |
BLU='\033[0;34m' | |
NC='\033[0m' | |
echo "" | |
echo "" | |
echo -e "GateKeeper Utility" | |
echo "" | |
echo "" | |
PS3='Please enter your choice: ' | |
options=("Disable GateKeeper" "Enable GateKeeper" "Allow Bypass for One App" "Quit") | |
select opt in "${options[@]}" | |
do | |
case $opt in | |
"Disable GateKeeper") | |
echo "" | |
echo -e "${GRN}Gatekeeper will now be disabled${NC}" | |
echo "" | |
echo -e "${RED}Please Enter Your Password${NC}" | |
echo "" | |
sudo spctl --master-disable | |
break | |
;; | |
"Enable GateKeeper") | |
echo "" | |
echo -e "${GRN}Gatekeeper will now be enabled.${NC}" | |
echo "" | |
echo -e "${RED}Please Enter Your Password${NC}" | |
echo "" | |
sudo spctl --master-enable | |
break | |
;; | |
"Allow Bypass for One App") | |
echo "" | |
echo -e "${GRN}One app will be allowed to bypass the gatekeeper.${NC}" | |
echo "" | |
read -e -p "Drag & Drop The App Here Then Hit Return: " FILEPATH | |
echo "" | |
echo -e "${RED}Please Enter Your Password${NC}" | |
echo "" | |
sudo xattr -rd com.apple.quarantine "$FILEPATH" | |
break | |
;; | |
"Quit") | |
break | |
;; | |
*) echo "invalid option $REPLY";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment