26 lines
603 B
Bash
26 lines
603 B
Bash
|
apt-get install unzip -y
|
||
|
wget https://github.com/rapiz1/rathole/releases/download/v0.5.0/rathole-x86_64-unknown-linux-gnu.zip
|
||
|
unzip rathole-x86_64-unknown-linux-gnu.zip
|
||
|
cp rathole /usr/bin/rathole
|
||
|
mkdir /etc/rathole
|
||
|
|
||
|
|
||
|
cat <<EOF > /etc/systemd/system/rathole.service
|
||
|
[Unit]
|
||
|
Description=Rathole Server Service
|
||
|
After=network.target
|
||
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
|
Restart=on-failure
|
||
|
RestartSec=5s
|
||
|
LimitNOFILE=1048576
|
||
|
|
||
|
# with root
|
||
|
ExecStart=/usr/bin/rathole -s /etc/rathole/rathole.toml
|
||
|
# without root
|
||
|
# ExecStart=%h/.local/bin/rathole -s %h/.local/etc/rathole/rathole.toml
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|
||
|
EOF
|