Last active
October 30, 2022 19:34
-
-
Save KalleDK/217cca2730d3597532f0e20cfccae0ae to your computer and use it in GitHub Desktop.
autossh
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=AutoSSH | |
Documentation=man:autossh(1) | |
After=network-online.target sshd.service | |
[Service] | |
EnvironmentFile=/etc/default/autossh | |
EnvironmentFile=/etc/autossh/autossh.conf | |
ExecStart=/usr/lib/autossh/autossh -M ${MONITOR_PORT} -nNT -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -i ${TUNNEL_KEY_PATH} -R ${TUNNEL_MAPPING} ${TUNNEL_USER}@${TUNNEL_HOST} | |
ExecReload=kill -SIGUSR1 $MAINPID | |
KillMode=mixed | |
Restart=on-failure | |
RestartSec=15 | |
Type=simple | |
[Install] | |
WantedBy=multi-user.target | |
Alias=autossh.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=VerifyInternet | |
Documentation=man:ping(1) | |
After=network-online.target sshd.service | |
Before=autossh.service | |
[Service] | |
EnvironmentFile=/etc/default/autossh | |
EnvironmentFile=/etc/autossh/autossh.conf | |
ExecStart=/usr/bin/ping -c 1 $TUNNEL_HOST | |
Restart=on-failure | |
RestartSec=15 | |
RemainAfterExit=yes | |
Type=oneshot | |
[Install] | |
WantedBy=multi-user.target | |
Alias=verify-internet.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment