wireguard-manager/docker/start.sh

35 lines
1 KiB
Bash

#!/bin/sh
set -e
# --------------------------------------------
# Ensure /etc/wireguard exists
# --------------------------------------------
if [ ! -d /etc/wireguard ]; then
echo "WARN: /etc/wireguard does not exist. Creating it..."
mkdir -p /etc/wireguard
fi
# Default config für WireGuard
if [ ! -f /etc/wireguard/wg0.conf ]; then
echo "INFO: Installing default WireGuard config..."
cp /defaults/wg0.conf /etc/wireguard/wg0.conf
fi
# --------------------------------------------
# Ensure /etc/nftables exists
# --------------------------------------------
if [ ! -d /etc/nftables ]; then
echo "WARN: /etc/nftables does not exist. Creating it..."
mkdir -p /etc/nftables
fi
# default nftables.conf
if [ ! -f /etc/nftables/nftables.conf ]; then
echo "INFO: Installing default nftables.conf..."
cp /defaults/nftables.conf /etc/nftables/nftables.conf
fi
# --------------------------------------------
# Start Supervisor
# --------------------------------------------
exec /usr/bin/supervisord -c /etc/supervisor.conf