Various edits

This commit is contained in:
Brian Zalewski 2024-05-20 07:48:38 +00:00
parent 5bf5599fc6
commit c44d1d17e1
5 changed files with 17 additions and 1 deletions

View file

@ -31,6 +31,7 @@ if command -v freshclam > /dev/null; then
logg info 'Unloading previous ClamAV clamdscan configuration'
sudo launchctl unload /Library/LaunchDaemons/clamdscan.plist
fi
logg info 'Running sudo launchctl load -w /Library/LaunchDaemons/clamdscan.plist'
sudo launchctl load -w /Library/LaunchDaemons/clamdscan.plist
if sudo launchctl list | grep 'clamav.freshclam' > /dev/null; then
logg info 'Unloading previous ClamAV freshclam configuration'
@ -41,6 +42,7 @@ if command -v freshclam > /dev/null; then
fi
### Update database
logg info 'Running freshclam to update database'
freshclam
else
logg info 'freshclam is not available in the PATH'

View file

@ -16,8 +16,10 @@ if command -v envchain > /dev/null; then
if [ -f "$HOME/.config/age/chezmoi.txt" ]; then
logg info 'Importing environment variables into the System keyring'
for file in {{ joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "*" }}; do
logg info "Adding $file to System keyring via envchain"
cat "$file" | chezmoi decrypt | envchain -s default "$(basename $file)" > /dev/null || logg info 'Importing "$(basename $file)" failed'
done
logg success "Added Chezmoi-managed secrets into System keyring via envchain"
else
logg warn 'Unable to import any variables into envchain because ~/.config/age/chezmoi.txt was not created by the secrets encryption process yet'
fi

View file

@ -28,7 +28,7 @@ if command -v fail2ban-client > /dev/null; then
fi
if [ -d /Applications ] && [ -d /System ]; then
### macOS
logg info 'Enabling the fail2ban Homebrew service' && brew services restart fail2ban
logg info 'Enabling the fail2ban Homebrew service' && sudo brew services restart fail2ban
else
### Linux
logg info 'Enabling the fail2ban service' && sudo systemctl enable fail2ban

View file

@ -56,6 +56,8 @@ if [ -n "$TAILSCALE_AUTH_KEY" ] && [ "$TAILSCALE_AUTH_KEY" != "" ]; then
if [ -n "$EXIT_CODE" ]; then
logg warn '/Applications/Tailscale.app/Contents/MacOS/Tailscale timed out'
fi
logg info 'Disabling update check'
/Applications/Tailscale.app/Contents/MacOS/Tailscale set --update-check=false
elif command -v tailscale > /dev/null && [ "$TAILSCALE_AUTH_KEY" != "" ]; then
logg info 'Connecting to Tailscale with user-defined authentication key (TAILSCALE_AUTH_KEY)'
timeout 30 tailscale up --authkey="$TAILSCALE_AUTH_KEY" --accept-routes || EXIT_CODE=$?
@ -64,6 +66,10 @@ if [ -n "$TAILSCALE_AUTH_KEY" ] && [ "$TAILSCALE_AUTH_KEY" != "" ]; then
else
logg success 'Connected to Tailscale network'
fi
logg info 'Disabling notifications about updates'
tailscale set --update-check=false
logg info 'Setting tailscale to auto-update'
tailscale set --auto-update
else
logg info 'tailscale does not appear to be installed'
fi

View file

@ -38,6 +38,12 @@ if command -v torify > /dev/null; then
if [ -d "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor" ] && [ ! -f "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc" ]; then
logg info "Symlinking /usr/local/etc/tor/torrc to ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc"
ln -s /usr/local/etc/tor/torrc "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc"
else
if [ -L "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc" ]; then
logg info ""${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc" symlinked"
else
logg warn ""${HOMEBREW_PREFIX:-/opt/homebrew}/etc/tor/torrc" not symlinked!"
fi
fi
logg info 'Running brew services restart tor'
brew services restart tor && logg success 'Tor successfully restarted'