addon-wireguard/wireguard/rootfs/etc/services.d/wireguard/run
2022-06-09 09:36:58 +02:00

23 lines
696 B
Text

#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: WireGuard
# Runs WireGuard
# ==============================================================================
declare interface
s6-svc -O /var/run/s6/services/wireguard
bashio::log.info "Starting WireGuard..."
# This is alpha software. We need to set this to instruct
# WireGuard we are OK to go.
export WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1
# Get the interface
interface="wg0"
if bashio::config.has_value "server.interface"; then
interface=$(bashio::config "server.interface")
fi
# Run the WireGuard
exec wg-quick up "${interface}"