summaryrefslogtreecommitdiff
path: root/lindy/systemd/secure-tunnel@.service
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-11-24 17:31:40 +0100
committerAlex Auvolat <alex@adnab.me>2021-11-24 17:31:40 +0100
commit3ffe74e408a0042b2b828d57a38322545d12db09 (patch)
tree89d2f7b66a0721d5bbbed81c252ba00465d373c6 /lindy/systemd/secure-tunnel@.service
parent4d828d6b228771a8131b0b278c93db8814e21bfd (diff)
downloaduser-config-3ffe74e408a0042b2b828d57a38322545d12db09.tar.gz
user-config-3ffe74e408a0042b2b828d57a38322545d12db09.zip
Add systemd conf and win10 vm conf
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
+