Skip to content

feat: add macOS support via Homebrew and launchd#4

Open
webjuantwo wants to merge 1 commit into
techchipnet:mainfrom
webjuantwo:add-macos
Open

feat: add macOS support via Homebrew and launchd#4
webjuantwo wants to merge 1 commit into
techchipnet:mainfrom
webjuantwo:add-macos

Conversation

@webjuantwo
Copy link
Copy Markdown

Summary

  • Adds OS detection via uname -s in all scripts; every existing Linux code path is unchanged
  • macOS installs tor and jq via Homebrew (no sudo required), patches torrc under $(brew --prefix)/etc/tor, and waits for Tor to be ready before starting IP rotation
  • New com.techchip.change-tor-ip.plist launchd template replaces the systemd unit on macOS — setup.sh renders and loads it as a user agent via launchctl
  • change_tor_ip.sh resolves TOR_COOKIE and log path at runtime based on OS (removes the HOME placeholder pattern)
  • README updated with macOS prerequisites, run-without-install, launchd service control, and uninstall instructions

Test plan

  • Run ./ip-changer.sh on macOS — verify brew installs tor/jq, torrc is patched, Tor starts, IPs rotate at the specified interval
  • Run ./setup.sh on macOS — verify ~/change_tor_ip.sh is deployed, launchd plist is loaded, ~/tor_ip_log.txt accumulates entries
  • Stop/start service via launchctl unload / launchctl load -w and confirm rotation pauses/resumes
  • Re-run ./setup.sh (idempotency) — confirm no duplicate torrc lines and plist reloads cleanly
  • Run ./ip-changer.sh and ./setup.sh on a supported Linux distro — confirm no regressions

- Detect OS via `uname -s` in ip-changer.sh and setup.sh; all Linux
  paths remain unchanged
- macOS setup installs tor and jq with brew (no sudo required), patches
  torrc under $(brew --prefix)/etc/tor, and waits for Tor to be ready
  before starting the rotation loop
- macOS service deployment (setup.sh) generates a launchd user-agent
  plist from the new com.techchip.change-tor-ip.plist template and
  loads it via launchctl, replacing the systemd flow
- change_tor_ip.sh now resolves TOR_COOKIE and LOG_FILE at runtime
  based on OS, removing the HOME placeholder pattern
- README updated with macOS prerequisites, run-without-install,
  launchd service control, and uninstall instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant