From 5e15833ff39f4de180fb24bddf03441cfd9a7cc3 Mon Sep 17 00:00:00 2001
From: Simon Zolin <s.zolin@adguard.com>
Date: Wed, 25 Sep 2019 18:21:36 +0300
Subject: [PATCH 1/2] + OpenRC service-script

---
 Home.md   |  3 ++-
 OpenRC.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 OpenRC.md

diff --git a/Home.md b/Home.md
index 529e1e8..9899c56 100644
--- a/Home.md
+++ b/Home.md
@@ -29,4 +29,5 @@ The wiki was just recently created, so there isn't much content (yet).
 * [Comparing AdGuard Home to other solutions](Comparison)
 * [AdGuard Home as a DNS-over-HTTPS or DNS-over-TLS server](Encryption)
 * [How to install and run AdGuard Home on Raspberry Pi](Raspberry-Pi)
-* [How to install and run AdGuard Home on a Virtual Private Server](VPS)
\ No newline at end of file
+* [How to install and run AdGuard Home on a Virtual Private Server](VPS)
+* [OpenRC service-script](OpenRC)
diff --git a/OpenRC.md b/OpenRC.md
new file mode 100644
index 0000000..b93ce5f
--- /dev/null
+++ b/OpenRC.md
@@ -0,0 +1,61 @@
+# OpenRC service-script
+
+A service-script for OpenRC-based systems, for example if you run AdGuard Home in Alpine (without using Docker).
+
+## Installation
+
+Install OpenRC:
+
+    apk update
+    apk add openrc
+
+Then copy the script below to /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 $?
+    }
+
+## Usage
+
+Enable running AdGuard Home on boot:
+
+    rc-update add adguardhome
+
+Controlling AdGuard Home:
+
+    service adguardhome <start|stop|restart|status|checkconfig>

From d7129c5aca7e24ba07a1687b50ff5919cadc1c32 Mon Sep 17 00:00:00 2001
From: Simon Zolin <s.zolin@adguard.com>
Date: Thu, 26 Sep 2019 13:20:07 +0300
Subject: [PATCH 2/2] + Sidebar: add "OpenRC service-script" link

---
 __Sidebar.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/__Sidebar.md b/__Sidebar.md
index 5c33056..5b42834 100644
--- a/__Sidebar.md
+++ b/__Sidebar.md
@@ -6,4 +6,5 @@
 * [Comparing AdGuard Home to other solutions](Comparison)
 * [AdGuard Home as a DNS-over-HTTPS or DNS-over-TLS server](Encryption)
 * [How to install and run AdGuard Home on Raspberry Pi](Raspberry-Pi)
-* [How to install and run AdGuard Home on a Virtual Private Server](VPS)
\ No newline at end of file
+* [How to install and run AdGuard Home on a Virtual Private Server](VPS)
+* [OpenRC service-script](OpenRC)