summaryrefslogtreecommitdiff
path: root/lindy/systemd/secure-tunnel@.service
diff options
context:
space:
mode:
Diffstat (limited to 'lindy/systemd/secure-tunnel@.service')
-rw-r--r--lindy/systemd/secure-tunnel@.service16
1 files changed, 16 insertions, 0 deletions
diff --git a/lindy/systemd/secure-tunnel@.service b/lindy/systemd/secure-tunnel@.service
new file mode 100644
index 0000000..5054dd2
--- /dev/null
+++ b/lindy/systemd/secure-tunnel@.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Setup a secure tunnel to %I
+After=network.target
+
+[Service]
+Environment="TARGET_PORT=22"
+EnvironmentFile=/home/lx/.config/secure-tunnel/%i.conf
+ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -p ${TARGET_PORT} ${TUNNEL_DEF} ${TARGET}
+
+# Restart every >2 seconds to avoid StartLimitInterval failure
+RestartSec=5
+Restart=always
+
+[Install]
+WantedBy=default.target
+