#!/usr/bin/env bash set -euo pipefail mkdir -p /opt/1panel/conf /opt/1panel/db /opt/1panel/log /opt/1panel/tmp /opt/1panel/geo if [ ! -f /opt/1panel/conf/app.yaml ]; then cp /usr/local/share/1panel/app.yaml /opt/1panel/conf/app.yaml fi /usr/local/bin/1panel-agent & agent_pid=$! /usr/local/bin/1panel-core & core_pid=$! term_handler() { kill "${core_pid}" "${agent_pid}" 2>/dev/null || true } trap term_handler SIGTERM SIGINT wait "${core_pid}" kill "${agent_pid}" 2>/dev/null || true wait "${agent_pid}" 2>/dev/null || true