-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Remove GitHub520 Hosts File | ||
After=network.target | ||
|
||
[Service] | ||
User=root | ||
PermissionsStartOnly=true | ||
ExecStart=/bin/bash -c 'sed -i "/# GitHub520 Host Start/,/# GitHub520 Host End/d" /etc/hosts' | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Update GitHub520 Hosts File | ||
After=network.target | ||
|
||
[Service] | ||
User=root | ||
PermissionsStartOnly=true | ||
ExecStart=/bin/bash -c 'sed -i "/# GitHub520 Host Start/Q" /etc/hosts && { wget -O - https://raw.hellogithub.com/hosts || wget -O - https://raw.githubusercontent.com/521xueweihan/GitHub520/main/hosts; } >> /etc/hosts' | ||
Restart=on-failure | ||
RestartSec=30 | ||
StartLimitInterval=3min | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Update GitHub520 Hosts File Timer | ||
|
||
[Timer] | ||
OnCalendar=*-*-* *:0/1:00 | ||
Persistent=true | ||
|
||
[Install] | ||
WantedBy=timers.target |