fix for older ssh that does not support Envrionment variable for Include
This commit is contained in:
14
README.md
14
README.md
@@ -1 +1,15 @@
|
|||||||
## Simple DIY VPN
|
## Simple DIY VPN
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
* Archlinux [AUR][0]
|
||||||
|
* Manual install: (run as root)
|
||||||
|
```
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
[0]: https://aur.archlinux.org/packages/diyvpn-git
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
Include ${SSH_CFG_PATH}
|
|
||||||
Host default
|
Host default
|
||||||
IdentitiesOnly yes
|
IdentitiesOnly yes
|
||||||
StreamLocalBindMask 0117
|
StreamLocalBindMask 0117
|
||||||
|
|||||||
11
diyvpn.sh
11
diyvpn.sh
@@ -36,10 +36,9 @@ generate() {
|
|||||||
|
|
||||||
idle_timeout="${IDLE_TIMEOUT:-10min}"
|
idle_timeout="${IDLE_TIMEOUT:-10min}"
|
||||||
listen_address="${LISTEN_ADDRESS:?LISTEN_ADDRESS should be set}"
|
listen_address="${LISTEN_ADDRESS:?LISTEN_ADDRESS should be set}"
|
||||||
header="# Automatically generated by $script_path"
|
|
||||||
|
|
||||||
cat >"$opdir/diyvpnssh-$name.service" <<-EOF
|
cat >"$opdir/diyvpnssh-$name.service" <<-EOF
|
||||||
$header
|
# Automatically generated by $script_path
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ssh to $name
|
Description=ssh to $name
|
||||||
SourcePath=$server_config_rc
|
SourcePath=$server_config_rc
|
||||||
@@ -50,12 +49,12 @@ generate() {
|
|||||||
NotifyAccess=all
|
NotifyAccess=all
|
||||||
|
|
||||||
RuntimeDirectory=diyvpn-$name
|
RuntimeDirectory=diyvpn-$name
|
||||||
Environment=SSH_CFG_PATH=$server_ssh_cfg
|
ExecStartPre=sh -c 'cat "$server_ssh_cfg" "$common_ssh_cfg_path" > %t/diyvpn-$name/ssh_config'
|
||||||
ExecStart=ssh -F "$common_ssh_cfg_path" default
|
ExecStart=ssh -F %t/diyvpn-$name/ssh_config default
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >"$opdir/diyvpnact-$name.service" <<-EOF
|
cat >"$opdir/diyvpnact-$name.service" <<-EOF
|
||||||
$header
|
# Automatically generated by $script_path
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Socket activator for diyvpn to server $name
|
Description=Socket activator for diyvpn to server $name
|
||||||
SourcePath=$server_config_rc
|
SourcePath=$server_config_rc
|
||||||
@@ -68,7 +67,7 @@ generate() {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat >"$opdir/diyvpnact-$name.socket" <<-EOF
|
cat >"$opdir/diyvpnact-$name.socket" <<-EOF
|
||||||
$header
|
# Automatically generated by $script_path
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Socket for diyvpn to server $name
|
Description=Socket for diyvpn to server $name
|
||||||
SourcePath=$server_config_rc
|
SourcePath=$server_config_rc
|
||||||
|
|||||||
Reference in New Issue
Block a user