Try process substitution fix

master
Keith Irwin 2022-09-10 09:23:27 -06:00
parent 6908b71140
commit f49d24cdcf
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ CONFIG_FILE='/etc/wgapi/config'
[ -f "${CONFIG_FILE}" ] || exit 5
source "${CONFIG_FILE}"
# Fix process substitiution if needed
# https://askubuntu.com/a/1250789
[ -d '/dev/fd' ] || ln -s '/proc/self/fd' '/dev/fd'
set -x
res="$(sudo /usr/bin/wg set "${TLD}" peer "${1}" preshared-key <(printf '%s\n' "${2}") allowed-ips "${3}" 2>&1)" || (
printf '%s %s\n' "${?}" "${res}" >>"${LOGFILE}"