#!/usr/bin/env bash set -euo pipefail PREFIX="${1:-/opt/mynetspeeder}" BIN_PATH="/usr/local/bin/mynetspeeder" PYTHON_BIN="${PYTHON_BIN:-$(command -v python3 || true)}" PACKAGE_PARENT="$(dirname "$PREFIX")" PACKAGE_NAME="$(basename "$PREFIX")" if [[ $EUID -ne 0 ]]; then echo "need root" exit 1 fi if [[ -z "$PYTHON_BIN" ]]; then echo "python3 not found" exit 1 fi if ! command -v rsync >/dev/null 2>&1; then echo "rsync not found" exit 1 fi mkdir -p "$PREFIX" rsync -a --delete /home/mynetspeeder/ "$PREFIX/" find "$PREFIX" -name '__pycache__' -type d -prune -exec rm -rf {} + cat > "$BIN_PATH" <