#!/usr/bin/env bashio
# shellcheck shell=bash

cat /etc/bashioenv > /etc/environment

if [ -f /vpn_stopped ]; then
  bashio::log.fatal 'Tunnel down, addon restarting in 15 seconds' &>/proc/1/fd/1
  sleep 15
  bashio::addon.restart &>/proc/1/fd/1
fi
