Last active
August 30, 2024 03:43
-
-
Save mayocream/8d7a01440f59e4d85771f74e23ad4744 to your computer and use it in GitHub Desktop.
/etc/systemd/system/clash.service
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
[Unit] | |
Description=Clash | |
After=network.target | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/etc/clash | |
User=root | |
ExecStart=/usr/local/bin/clash -d . | |
Restart=on-failure | |
LimitNOFILE=65536 | |
RestartSec=5s | |
[Install] | |
WantedBy=multi-user.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
wget https://hub.fastgit.org/Dreamacro/clash/releases/download/v1.8.0/clash-linux-amd64-v1.8.0.gz | |
gzip -d clash-linux-amd64-v1.8.0.gz | |
mv clash-linux-amd64-v1.8.0 clash | |
sudo mv clash /usr/local/bin/ | |
chmod +x /usr/local/bin/clash | |
# create clash systemd service | |
mkdir /etc/clash | |
cd /etc/clash | |
wget https://hub.fastgit.org/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb | |
# download clash config, rename it: config.yaml | |
sudo systemctl daemon-reload | |
sudo systemctl enable clash | |
sudo systemctl start clash | |
sudo systemctl status clash | |
# add these to .zshrc | |
export http_proxy=http://127.0.0.1:7890 | |
export https_proxy=http://127.0.0.1:7890 | |
export all_proxy=http://127.0.0.1:7890 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment