@@ -133,6 +133,58 @@ hosts 文件在每个系统的位置不一,详情如下:
133
133
134
134
### 2.3 一行命令 (适用于类 Unix 系统)
135
135
136
+ #### 使用 Systemd 管理的 Linux
137
+
138
+ <details >
139
+ <summary ><b >Linux 发行版中 systemd 软件包状态</b ></summary >
140
+
141
+ [ ![ Packaging status] ( https://repology.org/badge/vertical-allrepos/systemd.svg )] ( https://repology.org/project/systemd/versions )
142
+
143
+ </details >
144
+
145
+ ``` bash
146
+ # 方式 1 : 克隆 GitHub520 仓库
147
+ git clone https://github.com/521xueweihan/GitHub520.git
148
+
149
+ # 进入 GitHub520 仓库
150
+ cd GitHub520
151
+
152
+ # 方式 2:还可以通过下载 raw 文件方式下载相应的文件
153
+ wget -O remove-github520-hosts.service https://raw.githubusercontent.com/521xueweihan/GitHub520/main/remove-github520-hosts.service && \
154
+ wget -O update-github520-hosts.service https://raw.githubusercontent.com/521xueweihan/GitHub520/main/update-github520-hosts.service && \
155
+ wget -O update-github520-hosts.timer https://raw.githubusercontent.com/521xueweihan/GitHub520/main/update-github520-hosts.timer
156
+
157
+ # 安装 github520 host 的 systemd 服务到系统的 systemd 目录
158
+ sudo install -Dm0644 * -github520-hosts.* -t /usr/lib/systemd/system/
159
+
160
+ # 使用 systemd 的 systemctl 设置 github520 定时服务自启并运行
161
+ sudo systemctl enable --now update-github520-hosts.timer
162
+
163
+ # 使用 systemd 的 systemctl 设置 github520 服务运行,如果不手动需要等定时服务自动运行
164
+ sudo systemctl start update-github520-hosts.service
165
+
166
+ # 使用 systemd 的 systemctl 查看 github520 服务运行状态
167
+ sudo systemctl status update-github520-hosts.service
168
+
169
+ # 核查 /etc/hosts 修改
170
+ cat /etc/hosts
171
+
172
+ # 使用 systemd 的 systemctl 移除 github520 对 /etc/hosts 的修改
173
+ sudo systemctl start remove-github520-hosts.service
174
+
175
+ # 核查 /etc/hosts 修改
176
+ cat /etc/hosts
177
+
178
+ # 系统的 systemd 目录中删除 github520 host 的 systemd 服务
179
+ sudo rm -rf * -github520-hosts.* -t /usr/lib/systemd/system/
180
+ ```
181
+
182
+ - Arch Linux: [ AUR github520-git] ( https://aur.archlinux.org/packages/github520-git )
183
+
184
+ ``` bash
185
+ yay -Syu github520
186
+ ```
187
+
136
188
#### GNU(Ubuntu/CentOS/Fedora)
137
189
138
190
` sudo sh -c 'sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellohub.490633.xyz/hosts >> /etc/hosts' `
0 commit comments