Arx / install.sh
umer-wasim's picture
Install with one command (install.sh / install.ps1, checksum-verified); website install section
19b2935 verified
Raw History Blame Contribute Delete
5.59 kB
#!/bin/bash
# Arx installer for macOS and Linux:
# curl -fsSL https://devseis-arx.static.hf.space/install.sh | bash
# Downloads the current Arx release from Hugging Face (Devseis/endpoint-auditor-releases), checks its SHA-256 against the
# published SHA256SUMS, installs it and opens it. A file fetched with curl is not marked "downloaded from the internet",
# so macOS does not ask you to allow Arx in System Settings. Uninstall: ... | bash -s -- --uninstall
#
# macOS: Arx.app goes to /Applications (or ~/Applications if you cannot write there). No password is needed.
# Linux: the .deb on Debian/Ubuntu (sudo asks for your password), otherwise the AppImage in ~/Applications.
set -euo pipefail
RELEASES="https://huggingface.co/datasets/Devseis/endpoint-auditor-releases/resolve/main"
UNINSTALL=0; [ "${1:-}" = "--uninstall" ] && UNINSTALL=1
bold() { printf '\033[1m%s\033[0m\n' "$*"; }
step() { printf '\033[1;31m›\033[0m %s\n' "$*"; }
fail() { printf '\033[1;31mArx install stopped:\033[0m %s\n' "$*" >&2; exit 1; }
need() { command -v "$1" >/dev/null 2>&1 || fail "the command '$1' is needed but not found."; }
SUDO=sudo; [ "$(id -u)" -eq 0 ] && SUDO=""
OS=$(uname -s)
case "$OS" in Darwin|Linux) ;; *) fail "this installer is for macOS and Linux. On Windows use: irm https://devseis-arx.static.hf.space/install.ps1 | iex" ;; esac
# --- uninstall ---------------------------------------------------------------------------------------------------
if [ "$UNINSTALL" -eq 1 ]; then
bold "Removing Arx"
pkill -f "Arx.app/Contents/MacOS/Arx" 2>/dev/null || true
pkill -f "/opt/Arx/arx" 2>/dev/null || true
for app in /Applications/Arx.app "$HOME/Applications/Arx.app"; do [ -d "$app" ] && rm -rf "$app" && step "removed $app"; done
[ -f "$HOME/Applications/Arx.AppImage" ] && rm -f "$HOME/Applications/Arx.AppImage" "$HOME/.local/share/applications/arx.desktop" && step "removed the Arx AppImage"
if [ "$OS" = Linux ] && dpkg -s devseis-endpoint-auditor >/dev/null 2>&1; then step "removing the Arx package (sudo asks for your password)"; $SUDO apt-get remove -y devseis-endpoint-auditor >/dev/null; fi
echo "Your settings and reports were kept (Arx Reports in Documents; settings in the Devseis Endpoint Auditor folder)."
exit 0
fi
need curl
bold "Installing Arx — free security audit for your computer"
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
step "finding the current version"
curl -fsSL "$RELEASES/SHA256SUMS" -o "$TMP/SHA256SUMS" || fail "could not reach Hugging Face. Check the internet connection."
VERSION=$(curl -fsSL "$RELEASES/latest.json" | sed -n 's/.*"version": *"\([0-9.]*\)".*/\1/p' | head -1)
[ -n "$VERSION" ] || fail "could not read the current version."
pick() { awk -v f="$1" '$2 == f { print $1 }' "$TMP/SHA256SUMS"; }
fetch() { # file -> downloads it to $TMP and checks the SHA-256 against SHA256SUMS
local file=$1 want got
want=$(pick "$file"); [ -n "$want" ] || fail "$file is not in SHA256SUMS."
step "downloading $file"
curl -fL --progress-bar "$RELEASES/$file" -o "$TMP/$file" || fail "the download failed."
if command -v shasum >/dev/null 2>&1; then got=$(shasum -a 256 "$TMP/$file" | cut -d' ' -f1); else got=$(sha256sum "$TMP/$file" | cut -d' ' -f1); fi
[ "$got" = "$want" ] || fail "the download does not match the published checksum (expected $want, got $got). Nothing was installed."
step "checksum OK ($want)"
}
if [ "$OS" = Darwin ]; then
FILE="Arx-$VERSION-mac-universal.zip"
fetch "$FILE"
ditto -x -k "$TMP/$FILE" "$TMP/x" || fail "could not unpack Arx."
APP="$TMP/x/Arx/Arx.app"; [ -d "$APP" ] || APP="$TMP/x/Arx.app"; [ -d "$APP" ] || fail "Arx.app was not found in the download."
DEST=/Applications; [ -w "$DEST" ] || { DEST="$HOME/Applications"; mkdir -p "$DEST"; }
pkill -f "Arx.app/Contents/MacOS/Arx" 2>/dev/null && sleep 1 || true
rm -rf "$DEST/Arx.app"
ditto "$APP" "$DEST/Arx.app" || fail "could not copy Arx to $DEST."
xattr -dr com.apple.quarantine "$DEST/Arx.app" 2>/dev/null || true
step "installed Arx $VERSION in $DEST"
open "$DEST/Arx.app"
bold "Done. Arx is open. Next time, open it from $DEST or Launchpad."
else
if command -v apt-get >/dev/null 2>&1 && command -v dpkg >/dev/null 2>&1 && [ "$(uname -m)" = x86_64 ]; then
FILE="Arx-$VERSION-linux-x86_64.deb"
fetch "$FILE"
step "installing the package (sudo asks for your password)"
$SUDO apt-get install -y "$TMP/$FILE" >/dev/null || fail "apt could not install Arx."
step "installed Arx $VERSION"
(nohup /opt/Arx/arx >/dev/null 2>&1 &) || true
bold "Done. Arx is starting. Next time, open Arx from your applications menu."
elif [ "$(uname -m)" = x86_64 ]; then
FILE="Arx-$VERSION-linux-x86_64.AppImage"
fetch "$FILE"
mkdir -p "$HOME/Applications" "$HOME/.local/share/applications"
install -m 755 "$TMP/$FILE" "$HOME/Applications/Arx.AppImage"
printf '[Desktop Entry]\nName=Arx\nComment=Security audit for this computer\nExec=%s\nTerminal=false\nType=Application\nCategories=Utility;\n' "$HOME/Applications/Arx.AppImage" > "$HOME/.local/share/applications/arx.desktop"
step "installed Arx $VERSION in ~/Applications/Arx.AppImage"
(nohup "$HOME/Applications/Arx.AppImage" >/dev/null 2>&1 &) || true
bold "Done. Arx is starting. If it does not open, install FUSE (e.g. sudo dnf install fuse-libs) and run ~/Applications/Arx.AppImage."
else
fail "Arx for Linux needs a 64-bit Intel/AMD (x86_64) computer."
fi
fi