fix for older ssh that does not support Envrionment variable for Include

This commit is contained in:
2025-12-11 16:19:29 -05:00
parent c3d7a7725c
commit 9b4411409d
3 changed files with 19 additions and 7 deletions

View File

@@ -1 +1,15 @@
## Simple DIY VPN
## Features
## Installation
* Archlinux [AUR][0]
* Manual install: (run as root)
```
make install
```
## Usage
[0]: https://aur.archlinux.org/packages/diyvpn-git

View File

@@ -1,4 +1,3 @@
Include ${SSH_CFG_PATH}
Host default
IdentitiesOnly yes
StreamLocalBindMask 0117

View File

@@ -36,10 +36,9 @@ generate() {
idle_timeout="${IDLE_TIMEOUT:-10min}"
listen_address="${LISTEN_ADDRESS:?LISTEN_ADDRESS should be set}"
header="# Automatically generated by $script_path"
cat >"$opdir/diyvpnssh-$name.service" <<-EOF
$header
# Automatically generated by $script_path
[Unit]
Description=ssh to $name
SourcePath=$server_config_rc
@@ -50,12 +49,12 @@ generate() {
NotifyAccess=all
RuntimeDirectory=diyvpn-$name
Environment=SSH_CFG_PATH=$server_ssh_cfg
ExecStart=ssh -F "$common_ssh_cfg_path" default
ExecStartPre=sh -c 'cat "$server_ssh_cfg" "$common_ssh_cfg_path" > %t/diyvpn-$name/ssh_config'
ExecStart=ssh -F %t/diyvpn-$name/ssh_config default
EOF
cat >"$opdir/diyvpnact-$name.service" <<-EOF
$header
# Automatically generated by $script_path
[Unit]
Description=Socket activator for diyvpn to server $name
SourcePath=$server_config_rc
@@ -68,7 +67,7 @@ generate() {
EOF
cat >"$opdir/diyvpnact-$name.socket" <<-EOF
$header
# Automatically generated by $script_path
[Unit]
Description=Socket for diyvpn to server $name
SourcePath=$server_config_rc