Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated setup #78

Merged
merged 28 commits into from
Sep 28, 2024
Merged

Conversation

friendly-bits
Copy link
Collaborator

@friendly-bits friendly-bits commented Sep 27, 2024

Implements automated setup command, called when running sh /etc/init.d/adblock-lean setup or service adblock-lean setup:

  • Make the script executable (if not executable yet)
  • Create addnmount entry (if doesn't exist yet)
  • Call gen_config() if config file doesn't exist yet, or if the user chooses to recreate the config
  • If config file exists and the user chooses to keep it, call load_config() and upd_cron_job()
  • Enable the service (if not enabled yet)
  • Offer to install GNU utils if not installed yet (GNU awk, GNU sed, GNU sort)
  • Offer to start adblock-lean

gen_config():

  • New option cron_schedule (syntax: <cron_schedule_expression>|disable)
  • Offer to create a cron job with default schedule

Action enable: call upd_cron_job().
Action disable: call rm_cron_job().
Action disable: call stop().

Detect and report 3 types of wrong URLs:

  • 'github.com' URLs
  • Hagezi dnsmasq-formatted URLs in the raw-domains URLs options
  • Hagezi raw-domains URLs without the -onlydomains suffix

Updates README.md

@lynxthecat lynxthecat merged commit dcf42d2 into lynxthecat:master Sep 28, 2024
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.

2 participants