aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-01-07 19:49:00 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-01-07 19:55:08 +0100
commit1aabc8c2311e95b25ec0fa0dd03f8e21910730f8 (patch)
treea172c99b69b61909cf09ea2e1ef32a79be3ab4bb
parentMerge pull request #7 from sortlist/master (diff)
downloadsetup-wireguard-1aabc8c2311e95b25ec0fa0dd03f8e21910730f8.tar.gz
setup-wireguard-1aabc8c2311e95b25ec0fa0dd03f8e21910730f8.zip
fix some bash trickery
Diffstat (limited to '')
-rw-r--r--action.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/action.yml b/action.yml
index 7c75c81..7c9d685 100644
--- a/action.yml
+++ b/action.yml
@@ -144,21 +144,21 @@ runs:
additionnal_wg_args=()
if [ -n "$preshared_key" ]; then
- additionnal_wg_args+=("preshared-key \"${preshared_key_path}\"")
+ additionnal_wg_args+=(preshared-key "${preshared_key_path}")
fi
if [ -n "$keepalive" ]; then
- additionnal_wg_args+=("persistent-keepalive ${keepalive}")
+ additionnal_wg_args+=(persistent-keepalive "${keepalive}")
fi
sudo wg set "$ifname" \
peer "$endpoint_public_key" \
endpoint "$endpoint" \
allowed-ips "$allowed_ips" \
- ${additionnal_wg_args[@]}
+ ${additionnal_wg_args[@]+"${additionnal_wg_args[@]}"}
sudo ip link set "$ifname" up
-
+
# Add routes for allowed_ips
for i in ${allowed_ips//,/ }; do sudo ip route replace "$i" dev "$ifname"; done
}