mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 09:13:56 +00:00
Refactored formatting
This commit is contained in:
parent
2a12081f12
commit
11e1f2721e
@ -289,12 +289,12 @@ cat << "EOF" > /usr/local/sbin/strict.sh
|
||||
#! /bin/sh
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must run as root"
|
||||
printf "%s\n" "This script must run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
green=$'\e[1;32m'
|
||||
end=$'\e[0m'
|
||||
nc=$'\e[0m'
|
||||
|
||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /Applications/1Password\ 7.app
|
||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
||||
@ -308,7 +308,7 @@ printf "\n"
|
||||
|
||||
pfctl -F all -f /etc/pf.conf
|
||||
|
||||
printf "\n%s" "${green}Strict mode enabled${end}"
|
||||
printf "\n${green}%s${nc}\n" "Strict mode enabled"
|
||||
EOF
|
||||
chmod +x /usr/local/sbin/strict.sh
|
||||
```
|
||||
@ -322,7 +322,7 @@ cat << "EOF" > /usr/local/sbin/trusted.sh
|
||||
#! /bin/sh
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must run as root"
|
||||
printf "%s\n" "This script must run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -332,10 +332,10 @@ function disable()
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap disable HUP INT QUIT TERM
|
||||
trap disable INT
|
||||
|
||||
red=$'\e[1;31m'
|
||||
end=$'\e[0m'
|
||||
nc=$'\e[0m'
|
||||
|
||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /Applications/1Password\ 7.app
|
||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
||||
@ -349,7 +349,7 @@ printf "\n"
|
||||
|
||||
pfctl -F all -f /etc/pf.conf
|
||||
|
||||
printf "\n%s\n\n" "${red}Trusted mode enabled (press ctrl+c to disable)${end}"
|
||||
printf "\n${red}%s${nc}\n\n" "Trusted mode enabled (press ctrl+c to disable)"
|
||||
|
||||
while :
|
||||
do
|
||||
@ -366,7 +366,7 @@ cat << "EOF" > /usr/local/sbin/disabled.sh
|
||||
#! /bin/sh
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must run as root"
|
||||
printf "%s\n" "This script must run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -376,14 +376,14 @@ function disable()
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap disable HUP INT QUIT TERM
|
||||
trap disable INT
|
||||
|
||||
red=$'\e[1;31m'
|
||||
end=$'\e[0m'
|
||||
nc=$'\e[0m'
|
||||
|
||||
pfctl -d
|
||||
|
||||
printf "\n%s\n\n" "${red}Firewall disabled (press ctrl+c to enable)${end}"
|
||||
printf "\n${red}%s${nc}\n\n" "Firewall disabled (press ctrl+c to enable)"
|
||||
|
||||
while :
|
||||
do
|
||||
|
@ -21,7 +21,7 @@ Publication date: 2020-06-18T00:00:00.000Z
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
```
|
||||
|
||||
### Step 2: disable analytics
|
||||
### Step 2: disable Homebrew analytics
|
||||
|
||||
```shell
|
||||
brew analytics off
|
||||
|
@ -40,21 +40,21 @@ export LC_CTYPE=C
|
||||
dirname=`dirname "${BASH_SOURCE}"`
|
||||
|
||||
# Spoof computer name
|
||||
model_name=`system_profiler SPHardwareDataType | awk '/Model Name/ {$1=$2=""; print $0}' | sed -e 's/^[ ]*//'`
|
||||
first_name=`sed "$(jot -r 1 1 2048)q;d" $dirname/first_names.txt | sed -e 's/[^a-zA-Z]//g'`
|
||||
computer_name=`echo "$first_name’s $model_name"`
|
||||
model_name=`system_profiler SPHardwareDataType | awk '/Model Name/ {$1=$2=""; print $0}' | sed -e 's/^[ ]*//'`
|
||||
computer_name="$first_name’s $model_name"
|
||||
host_name=`echo $computer_name | sed -e 's/’//g' | sed -e 's/ /-/g'`
|
||||
sudo scutil --set ComputerName "$computer_name"
|
||||
sudo scutil --set LocalHostName "$host_name"
|
||||
sudo scutil --set HostName "$host_name"
|
||||
echo "Spoofed hostname to $host_name"
|
||||
printf "%s\n" "Spoofed hostname to $host_name"
|
||||
|
||||
# Spoof MAC address of en0 interface
|
||||
mac_address_prefix=`sed "$(jot -r 1 1 768)q;d" $dirname/mac_address_prefixes.txt | sed -e 's/[^A-F0-9:]//g'`
|
||||
mac_address_suffix=`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
|
||||
mac_address=`echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}'`
|
||||
sudo ifconfig en0 ether "$mac_address"
|
||||
echo "Spoofed MAC address of en0 interface to $mac_address"
|
||||
printf "%s\n" "Spoofed MAC address of en0 interface to $mac_address"
|
||||
EOF
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user