Fixes WSL check on macOS
This commit is contained in:
parent
40b79ff153
commit
2021e855a0
9 changed files with 12 additions and 12 deletions
|
@ -2,7 +2,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
### Configure CloudFlare WARP (if not WSL and warp-cli is installed)
|
### Configure CloudFlare WARP (if not WSL and warp-cli is installed)
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]] && command -v warp-cli > /dev/null; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]] && command -v warp-cli > /dev/null; then
|
||||||
### Register CloudFlare WARP
|
### Register CloudFlare WARP
|
||||||
if warp-cli --accept-tos status | grep 'Registration missing' > /dev/null; then
|
if warp-cli --accept-tos status | grep 'Registration missing' > /dev/null; then
|
||||||
logg info 'Registering CloudFlare WARP'
|
logg info 'Registering CloudFlare WARP'
|
||||||
|
|
|
@ -87,7 +87,7 @@ if command -v nmcli > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Restart NetworkManager if changes were made and environment is not WSL
|
### Restart NetworkManager if changes were made and environment is not WSL
|
||||||
if [ "$RESTART_NM" == 'true' ] && [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [ "$RESTART_NM" == 'true' ] && [[ ! "$(test -d proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
logg info 'Restarting NetworkManager since VPN profiles were updated'
|
logg info 'Restarting NetworkManager since VPN profiles were updated'
|
||||||
sudo service NetworkManager restart
|
sudo service NetworkManager restart
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -28,7 +28,7 @@ if command -v toron > /dev/null; then
|
||||||
# macOS
|
# macOS
|
||||||
brew services restart tor
|
brew services restart tor
|
||||||
else
|
else
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
# Linux
|
# Linux
|
||||||
sudo systemctl enable tor
|
sudo systemctl enable tor
|
||||||
sudo systemctl restart tor
|
sudo systemctl restart tor
|
||||||
|
|
|
@ -28,7 +28,7 @@ if command -v privoxy > /dev/null; then
|
||||||
# macOS
|
# macOS
|
||||||
brew services restart privoxy
|
brew services restart privoxy
|
||||||
else
|
else
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
# Linux
|
# Linux
|
||||||
sudo systemctl enable privoxy
|
sudo systemctl enable privoxy
|
||||||
sudo systemctl restart privoxy
|
sudo systemctl restart privoxy
|
||||||
|
|
|
@ -56,7 +56,7 @@ if command -v vmware > /dev/null; then
|
||||||
logg info '/usr/lib/vmware/isoimages/darwin.iso is already present on the system so VMware macOS unlocking will not be performed'
|
logg info '/usr/lib/vmware/isoimages/darwin.iso is already present on the system so VMware macOS unlocking will not be performed'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
### Start / enable VMWare service
|
### Start / enable VMWare service
|
||||||
logg info 'Ensuring `vmware.service` is enabled and running'
|
logg info 'Ensuring `vmware.service` is enabled and running'
|
||||||
sudo systemctl enable vmware.service
|
sudo systemctl enable vmware.service
|
||||||
|
|
|
@ -177,7 +177,7 @@ if [ ! -d /Applications ] || [ ! -d /System ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart / enable Docker
|
# Restart / enable Docker
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]] && command -v systemctl > /dev/null; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]] && command -v systemctl > /dev/null; then
|
||||||
logg info 'Restarting Docker service'
|
logg info 'Restarting Docker service'
|
||||||
sudo systemctl restart docker.service
|
sudo systemctl restart docker.service
|
||||||
sudo systemctl restart containerd.service
|
sudo systemctl restart containerd.service
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{{ includeTemplate "universal/logg" }}
|
{{ includeTemplate "universal/logg" }}
|
||||||
|
|
||||||
### Update /etc/endlessh/config if environment is not WSL
|
### Update /etc/endlessh/config if environment is not WSL
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
if command -v endlessh > /dev/null; then
|
if command -v endlessh > /dev/null; then
|
||||||
if [ -d /etc/endlessh ]; then
|
if [ -d /etc/endlessh ]; then
|
||||||
logg info 'Copying ~/.ssh/endlessh/config to /etc/endlessh/config'
|
logg info 'Copying ~/.ssh/endlessh/config to /etc/endlessh/config'
|
||||||
|
|
|
@ -22,7 +22,7 @@ function restartFail2Ban() {
|
||||||
}
|
}
|
||||||
|
|
||||||
### Update the jail.local file if environment is not WSL
|
### Update the jail.local file if environment is not WSL
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
if [ -d /etc/fail2ban ]; then
|
if [ -d /etc/fail2ban ]; then
|
||||||
logg info 'Copying ~/.ssh/fail2ban/jail.local to /etc/fail2ban/jail.local'
|
logg info 'Copying ~/.ssh/fail2ban/jail.local to /etc/fail2ban/jail.local'
|
||||||
sudo cp -f "$HOME/.ssh/fail2ban/jail.local" /etc/fail2ban/jail.local
|
sudo cp -f "$HOME/.ssh/fail2ban/jail.local" /etc/fail2ban/jail.local
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{{ includeTemplate "universal/logg" }}
|
{{ includeTemplate "universal/logg" }}
|
||||||
|
|
||||||
### Update /etc/ssh/sshd_config if environment is not WSL
|
### Update /etc/ssh/sshd_config if environment is not WSL
|
||||||
if [[ ! "$(grep Microsoft /proc/version > /dev/null)" ]]; then
|
if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then
|
||||||
if [ -d /etc/ssh ]; then
|
if [ -d /etc/ssh ]; then
|
||||||
logg info 'Copying ~/.ssh/system/banner to /etc/ssh/banner'
|
logg info 'Copying ~/.ssh/system/banner to /etc/ssh/banner'
|
||||||
sudo cp -f "$HOME/.ssh/system/banner" /etc/ssh/banner
|
sudo cp -f "$HOME/.ssh/system/banner" /etc/ssh/banner
|
||||||
|
|
Loading…
Reference in a new issue