#!/bin/bash starting() { echo "Creating user" bash /docker/init.sh echo "Starting danted" danted -p -d 2 /danted.pid } ending() { echo "Stopping danted" kill -9 $(cat /danted.pid) echo "Stopping container" } trap ending SIGINT SIGTERM echo "Starting container" starting