Skip to content

Instantly share code, notes, and snippets.

@vietanhduong
Last active April 1, 2021 03:29
Show Gist options
  • Save vietanhduong/85aa97a9d26585653615df371379aad3 to your computer and use it in GitHub Desktop.
Save vietanhduong/85aa97a9d26585653615df371379aad3 to your computer and use it in GitHub Desktop.
Gate Keeper
#!/bin/bash
RED='\033[0;31m'
GRN='\033[0;32m'
BLU='\033[0;34m'
NC='\033[0m'
PS3='Please enter your choice: '
options=("Disable Your GateKeeper" "Enable Your GateKeeper" "Allow Single App To ByPass The GateKeeper" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Disable Your GateKeeper")
echo ""
echo -e "${GRN}You Chose To Disable Your GateKeeper${NC}"
echo ""
echo -e "${RED}Plaese Inseret Your Password To Procceed${NC}"
echo ""
sudo spctl --master-disable
break
;;
"Enable Your GateKeeper")
echo ""
echo -e "${GRN}You Chose To Enable Your GateKeeper${NC}"
echo ""
echo -e "${RED}Plaese Inseret Your Password To Procceed${NC}"
echo ""
sudo spctl --master-enable
break
;;
"Allow Single App To ByPass The GateKeeper")
echo ""
echo -e "${GRN}You Chose To Allow Single App To ByPass The GateKeeper${NC}"
echo ""
read -e -p "Drag & Drop The App Here Then Hit Return: " FILEPATH
echo ""
echo -e "${RED}Plaese Inseret Your Password To Procceed${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