mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-05-13 22:06:55 +02:00
add hans systemd unit
This commit is contained in:
parent
e81047a200
commit
5f876b0858
4
hans/systemd/hans
Normal file
4
hans/systemd/hans
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# /etc/default/hans
|
||||||
|
GATEWAY=192.168.31.1
|
||||||
|
SERVER=1.2.3.4
|
||||||
|
PASSWORD=password
|
17
hans/systemd/hans.service
Normal file
17
hans/systemd/hans.service
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# /etc/systemd/system/hans.service
|
||||||
|
[Unit]
|
||||||
|
Description=IP over ICMP
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=/etc/default/hans
|
||||||
|
ExecStartPre=/bin/ping -c 1 $SERVER
|
||||||
|
ExecStart=/usr/local/bin/hans -f -c $SERVER -p $PASSWORD
|
||||||
|
ExecStartPost=/bin/sleep 5
|
||||||
|
ExecStartPost=-/sbin/ip route add $SERVER via $GATEWAY
|
||||||
|
ExecStartPost=/sbin/ip route add 0.0.0.0/1 dev tun0
|
||||||
|
ExecStartPost=/sbin/ip route add 128.0.0.0/1 dev tun0
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user