mirror of
https://github.com/hassio-addons/addon-wireguard.git
synced 2025-05-04 19:01:31 +00:00
23 lines
696 B
Text
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}"
|