diff --git a/README.md b/README.md index ae9283c..42b544a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Proxer +> **Subscribe to us on [Telegram](https://t.me/macproxer) to receive notifications about new versions and updates.** + Proxying TCP traffic on macOS with domain filtering via UI ![proxer screenshot](proxer.png) @@ -26,7 +28,3 @@ In the future, releases will be signed with a certificate, and you will be able ```bash curl -fsSL https://raw.githubusercontent.com/doroved/proxer/main/install.sh | bash ``` - -## Links - -[Proxer Channel TG](https://t.me/macproxer) - subscribe to not miss important updates. diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..883def1 --- /dev/null +++ b/install.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Check architecture +arch=$(uname -m) +if [[ "$arch" != "x86_64" && "$arch" != "arm64" ]]; then + echo "Error: Unsupported architecture $arch. Exiting script." + exit 1 +fi + +# Determine the appropriate architecture for the orb command +if [ "$arch" = "arm64" ]; then + short_arch="aarch64" +else + short_arch="x64" +fi + +# Get version from API +version=$(curl -s "https://api.github.com/repos/doroved/proxer/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//') + +# Name of the downloaded file +downloaded_file="proxer_${version}_${short_arch}.dmg" + +# Download the file +curl -OL "https://github.com/doroved/proxer/releases/download/v${version}/$downloaded_file" + +# Check if the file exists in ~/Downloads, if not - move it +if [ ! -f "$HOME/Downloads/$downloaded_file" ]; then + mv "$downloaded_file" "$HOME/Downloads/" + echo "File moved to ~/Downloads/" +fi + +# Remove quarantine from the file +if xattr "$HOME/Downloads/$downloaded_file" | grep -q "com.apple.quarantine"; then + xattr -d com.apple.quarantine "$HOME/Downloads/$downloaded_file" + echo "Quarantine removed from file $HOME/Downloads/$downloaded_file" +fi + +# Run the file +open "$HOME/Downloads/$downloaded_file"