天增的博客
首页
博客
  • 分布式解决方案
  • Java并发工具包
  • redis
  • LeetCode
  • 系统设计
  • JVM体系
Github (opens new window)
Rss (opens new window)
  • zh-CN
  • en-US
首页
博客
  • 分布式解决方案
  • Java并发工具包
  • redis
  • LeetCode
  • 系统设计
  • JVM体系
Github (opens new window)
Rss (opens new window)
  • zh-CN
  • en-US
  • posts
  • 软路由
  • 在上Alpine Linux安装Adguard Home
2022-04-21

在上Alpine Linux安装Adguard Home

# 在上Alpine Linux安装Adguard Home


title: '在上Alpine Linux安装Adguard Home'
date: 2021-12-19 14:52:15
tags: [软路由]
published: true
hideInList: false
feature:
isTop: false


由于没有Systemd, Adguard Home的官网的安装方法在Alpine Linux上无法工作。 然而,需要用OpenRC运行它非常简单。

  1. 通过 curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v 进行安装

  2. 编写命令 vim /etc/init.d/AdguardHome

    #!/sbin/openrc-run
    #
    # openrc service-script for AdGuardHome
    #
    # place in /etc/init.d/
    # start on boot: "rc-update add adguardhome"
    # control service: "service adguardhome <start|stop|restart|status|checkconfig>"
    #
    
    description="AdGuard Home: Network-level blocker"
    
    pidfile="/run/$RC_SVCNAME.pid"
    command="/opt/AdGuardHome/AdGuardHome"
    command_args="-s run"
    command_background=true
    
    extra_commands="checkconfig"
    
    depend() {
      need net
      provide dns
      after firewall
    }
    
    checkconfig() {
      "$command" --check-config || return 1
    }
    
    stop() {
      if [ "${RC_CMD}" = "restart" ] ; then
        checkconfig || return 1
      fi
    
      ebegin "Stopping $RC_SVCNAME"
      start-stop-daemon --stop --exec "$command" \
        --pidfile "$pidfile" --quiet
      eend $?
    }
    
  3. 启动服务,并开启自启动

    chmod +x /etc/init.d/AdguardHome rc-update add AdguardHome rc-service AdguardHome start

‍

最近更新
01
以 root 身份启动 transmission-daemon
12-13
02
Debian系统安装qbittorrent-nox
12-09
03
LXC Debain12安装zerotier并实现局域网自动nat转发
07-29
更多文章>
Theme by Vdoing | Copyright © 2015-2024 天增 | 苏ICP备16037388号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式